Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
synnefo
Commits
c56d0588
Commit
c56d0588
authored
Jun 11, 2013
by
Georgios D. Tsoukalas
Browse files
common: Add a get_service_path() function
parent
dfa67fa3
Changes
1
Hide whitespace changes
Inline
Side-by-side
snf-common/synnefo/lib/services.py
View file @
c56d0588
...
...
@@ -34,6 +34,7 @@
from
copy
import
deepcopy
from
synnefo.lib
import
join_urls
from
synnefo.util.keypath
import
get_path
,
set_path
from
urlparse
import
urlparse
def
fill_endpoints
(
services
,
base_url
):
...
...
@@ -79,3 +80,8 @@ def get_public_endpoint(services, service_type, version=None):
selected
=
sorted
(
found_endpoints
.
keys
())[
-
1
]
return
found_endpoints
[
selected
][
'publicURL'
]
def
get_service_path
(
services
,
service_type
,
version
=
None
):
service_url
=
get_public_endpoint
(
services
,
service_type
,
version
=
version
)
return
urlparse
(
service_url
).
path
.
rstrip
(
'/'
)
+
'/'
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment