Merge "Add help for --plan, add --stack"

This commit is contained in:
Zuul 2018-02-12 12:40:33 +00:00 committed by Gerrit Code Review
commit 22e4d44314
2 changed files with 13 additions and 2 deletions

View File

@ -0,0 +1,6 @@
---
fixes:
- In order to use tripleo-ansible-inventory with a different stack name, that
name had to be specified with --plan. This commit adds help for the --plan
cli arg, and also adds a new --stack cli arg that has the same effect. If
both are specified, --stack will take precedence.

View File

@ -51,7 +51,12 @@ 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.StrOpt('plan', default=os.environ.get('TRIPLEO_PLAN_NAME')),
cfg.StrOpt('plan', default=os.environ.get('TRIPLEO_PLAN_NAME'),
help=('stack name to use for generating the '
'inventory data.')),
cfg.StrOpt('stack', help=('This arg has the same effect '
'as --plan. If both are specified, --stack '
'will take precedence.')),
cfg.StrOpt('ansible_ssh_user', default=os.environ.get('ANSIBLE_SSH_USER',
'heat-admin')),
]
@ -128,7 +133,7 @@ def main():
project_name=configs.project_name,
username=configs.username,
ansible_ssh_user=configs.ansible_ssh_user,
plan_name=configs.plan)
plan_name=configs.stack or configs.plan)
if configs.list or configs.static_inventory:
try: