Ensure that OpenStack environment variable credentials exist

This is needed for the call to glance to import the metadata.
This commit is contained in:
Rob Crittenden 2016-09-14 11:12:41 -04:00
parent dc7189d262
commit 8341a3a016
1 changed files with 8 additions and 0 deletions

View File

@ -94,6 +94,14 @@ def install(args):
if not os.path.exists('/etc/ipa/default.conf'):
raise ConfigurationError('Must be enrolled in IPA')
try:
os.environ['OS_PASSWORD']
os.environ['OS_USERNAME']
os.environ['OS_AUTH_URL']
except KeyError as e:
raise ConfigurationError('%s environment variable not set.'
% e.message)
api.bootstrap(context='novajoin')
api.finalize()