Skip to content

Commit

Permalink
Don't use CloudConfig.get_session_endpoint()
Browse files Browse the repository at this point in the history
  • Loading branch information
Akira Yoshiyama committed Jan 20, 2017
1 parent e487a4c commit f69280a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions oscurl/oscurl.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,16 @@ def get_token(cloud_config, options):
'or OS_CLOUD)')
sys.exit(1)

endpoint_url = cloud.get_session_endpoint(options.service)
if not endpoint_url:
# CloudConfig.get_session_endpoint() is broken for identity
session = cloud.get_session()
args = {
'service_type': cloud.get_service_type(options.service),
'interface': cloud.get_interface(options.api),
'region_name': cloud.region
}
try:
endpoint_url = session.get_endpoint(**args)
except keystoneauth1.exceptions.catalog.EndpointNotFound:
print "No endpoint is found for service '%s'" % options.service
print ("(Note that service name like 'nova' or 'cinder' is "
"no longer supported.)")
Expand Down

0 comments on commit f69280a

Please sign in to comment.