Fix get plan_name default value for inventory script

Since the default value has been updated to return a list
for the plan_name value, if the os.environ.get is None
then the default is a list with a None value: ['None']

We need to set a real None value, in order to set the
default 'overcloud' value.

Change-Id: Ia84e458c4a79f0a606d15e1b2739b48e5bbda21e
This commit is contained in:
Mathieu Bultel 2019-09-24 16:56:29 +02:00
parent 1d85e29f79
commit 5004e64c66
1 changed files with 4 additions and 2 deletions

View File

@ -46,7 +46,9 @@ opts = [
cfg.StrOpt('project-name', default=os.environ.get(
'OS_PROJECT_NAME', os.environ.get('OS_TENANT_NAME'))),
cfg.StrOpt('cacert', default=os.environ.get('OS_CACERT')),
cfg.ListOpt('plan', default=[os.environ.get('TRIPLEO_PLAN_NAME')],
cfg.ListOpt('plan',
default=([os.environ.get('TRIPLEO_PLAN_NAME')]
if os.environ.get('TRIPLEO_PLAN_NAME') else None),
help=('stack name(s) to use for generating the '
'inventory data. If a comma delimited list '
'of stacks is passed, the inventory will '
@ -84,7 +86,7 @@ def _parse_config():
if '/v2.0' in configs.auth_url:
configs.auth_url = configs.auth_url.replace('/v2.0', '/v3')
if not configs.plan:
configs.plan = 'overcloud'
configs.plan = ['overcloud']
return configs