set default credentials when cred file not provided

This commit is contained in:
Jake McDermott 2019-08-21 10:01:43 -04:00
parent 858f43fd2a
commit 94d6fcbe39

View File

@ -60,13 +60,17 @@ def main():
if akit_args.credential_file != utils.not_provided:
config.credentials = utils.load_credentials(
akit_args.credential_file)
else:
config.credentials = utils.PseudoNamespace({
'default': {
'username': os.getenv('AWXKIT_USER', 'admin'),
'password': os.getenv('AWXKIT_USER_PASSWORD', 'password')
}
})
if akit_args.project_file != utils.not_provided:
config.project_urls = utils.load_projects(
akit_args.project_file)
else:
config.credentials = utils.PseudoNamespace({'default': {'username': os.getenv(
'AWXKIT_USER', 'admin'), 'password': os.getenv('AWXKIT_USER_PASSWORD', 'password')}})
global root
root = api.Api()