syntax errors and undefined exceptions in service_description.py

openstack/service_description.py had several fatal errors:

- The _make_proxy method attempted to reference a variable named
  api_version when no such variable was in scope.
- There was a syntax error in the associated format string.
- There were multiple references to an UnsupportedVersion exception
  when no such exception exists.

This commit corrects all of the above.

Change-Id: If7826913883c34d0a1b09efef1d7f74c90bccdee
This commit is contained in:
Lars Kellogg-Stedman 2018-11-16 07:43:41 -05:00 committed by Monty Taylor
parent 0e7326810a
commit 8d71f764e4
1 changed files with 5 additions and 6 deletions

View File

@ -118,7 +118,7 @@ class ServiceDescription(object):
" have direct passthrough REST capabilities.".format(
version=version_string,
service_type=self.service_type),
category=exceptions.UnsupportedVersionWarning)
category=exceptions.UnsupportedServiceVersion)
elif endpoint_override and self.supported_versions:
temp_adapter = config.get_session_client(
self.service_type
@ -133,14 +133,14 @@ class ServiceDescription(object):
)
else:
warnings.warn(
"Service {service_type) has an endpoint override set"
"Service {service_type} has an endpoint override set"
" but the version discovered at that endpoint, {version}"
" is not supported by openstacksdk. The resulting Proxy"
" object will only have direct passthrough REST"
" capabilities.".format(
version=api_version,
service_type=self.service_type),
category=exceptions.UnsupportedVersionWarning)
category=exceptions.UnsupportedServiceVersion)
if proxy_obj:
@ -193,12 +193,11 @@ class ServiceDescription(object):
# service catalog that also doesn't have any useful
# version discovery?
warnings.warn(
"Service {service_type) has no discoverable version."
"Service {service_type} has no discoverable version."
" The resulting Proxy object will only have direct"
" passthrough REST capabilities.".format(
version=api_version,
service_type=self.service_type),
category=exceptions.UnsupportedVersionWarning)
category=exceptions.UnsupportedServiceVersion)
return temp_adapter
proxy_class = self.supported_versions.get(str(found_version[0]))
if not proxy_class: