Fix typo in exception name
Changed exception name from MetadaNotFoundException to MetadataNotFoundException. Change-Id: I94be8c930ede4163a4f909452ccb530b14999a48
This commit is contained in:
parent
b862ccf2c3
commit
921e1b8962
@ -34,7 +34,7 @@ class ServiceException(Exception):
|
||||
pass
|
||||
|
||||
|
||||
class MetadaNotFoundException(CloudbaseInitException):
|
||||
class MetadataNotFoundException(CloudbaseInitException):
|
||||
|
||||
"""Exception thrown in case no metadata service is found."""
|
||||
|
||||
|
@ -188,7 +188,7 @@ class InitManager(object):
|
||||
if not (reboot_required and CONF.allow_reboot):
|
||||
try:
|
||||
service = metadata_factory.get_metadata_service()
|
||||
except exception.MetadaNotFoundException:
|
||||
except exception.MetadataNotFoundException:
|
||||
LOG.error("No metadata service found")
|
||||
if service:
|
||||
LOG.info('Metadata service loaded: \'%s\'' %
|
||||
|
@ -34,4 +34,4 @@ def get_metadata_service():
|
||||
except Exception as ex:
|
||||
LOG.error("Failed to load metadata service '%s'" % class_path)
|
||||
LOG.exception(ex)
|
||||
raise exception.MetadaNotFoundException("No available service found")
|
||||
raise exception.MetadataNotFoundException("No available service found")
|
||||
|
@ -75,7 +75,7 @@ class AzureService(base.BaseHTTPMetadataService):
|
||||
options = dhcp.get_dhcp_options()
|
||||
endpoint = (options or {}).get(WIRESERVER_DHCP_OPTION)
|
||||
if not endpoint:
|
||||
raise exception.MetadaNotFoundException(
|
||||
raise exception.MetadataNotFoundException(
|
||||
"Cannot find Azure WireServer endpoint address")
|
||||
return socket.inet_ntoa(endpoint)
|
||||
except Exception:
|
||||
@ -88,7 +88,7 @@ class AzureService(base.BaseHTTPMetadataService):
|
||||
if "x-ms-version" not in self._headers:
|
||||
versions = self._get_versions()
|
||||
if WIRE_SERVER_VERSION not in versions.Versions.Supported.Version:
|
||||
raise exception.MetadaNotFoundException(
|
||||
raise exception.MetadataNotFoundException(
|
||||
"Unsupported Azure WireServer version: %s" %
|
||||
WIRE_SERVER_VERSION)
|
||||
self._headers["x-ms-version"] = WIRE_SERVER_VERSION
|
||||
|
@ -66,7 +66,7 @@ class AzureServiceTest(unittest.TestCase):
|
||||
dhcp_option=None):
|
||||
mock_dhcp.return_value = dhcp_option
|
||||
if not dhcp_option:
|
||||
self.assertRaises(exception.MetadaNotFoundException,
|
||||
self.assertRaises(exception.MetadataNotFoundException,
|
||||
(self._azureservice.
|
||||
_get_wire_server_endpoint_address))
|
||||
else:
|
||||
@ -409,7 +409,7 @@ class AzureServiceTest(unittest.TestCase):
|
||||
mock_get_versions.return_value = mock_version
|
||||
mock_version.Versions.Supported.Version = [version]
|
||||
if self._azureservice_module.WIRE_SERVER_VERSION is not version:
|
||||
self.assertRaises(exception.MetadaNotFoundException,
|
||||
self.assertRaises(exception.MetadataNotFoundException,
|
||||
self._azureservice._check_version_header)
|
||||
else:
|
||||
self._azureservice._check_version_header()
|
||||
|
Loading…
x
Reference in New Issue
Block a user