Initialize service var before the metadata discovery

The service variable needs to be initialized before the
metadata discovery check, as a plugin might request a reboot
after the pre-metadata stage and the service variable will remain
uninitialized.

Closes-bug: #1666258
Change-Id: I4028b76f787267476b5320e5a480f54b58c59293
This commit is contained in:
Adrian Vladu 2017-02-20 17:28:53 +02:00
parent ec8a8cd0d6
commit c26ea83ad6
1 changed files with 1 additions and 1 deletions

View File

@ -159,6 +159,7 @@ class InitManager(object):
sys.exit(exit_code)
def configure_host(self):
service = None
osutils = osutils_factory.get_os_utils()
if CONF.reset_service_password and sys.platform == 'win32':
@ -183,7 +184,6 @@ class InitManager(object):
service = metadata_factory.get_metadata_service()
except exception.MetadaNotFoundException:
LOG.error("No metadata service found")
service = None
if service:
LOG.info('Metadata service loaded: \'%s\'' %
service.get_name())