From 80c842c09d7f18d0f27c0ee528b4e1683b7c413b Mon Sep 17 00:00:00 2001 From: James Slagle Date: Fri, 9 Feb 2018 14:40:52 -0500 Subject: [PATCH] Add help for --plan, add --stack In order to use tripleo-ansible-inventory with a different stack name, you had to know to specify that name with --plan. This commit adds help for the --plan cli arg, and also adds a new --stack cli arg that has the same effect. --stack is more consistent with other cli tools in TripleO. If both are specified, --stack will take precedence. Change-Id: I64b2c66eb2d37f0f231895c0cec3f8415de9f342 --- releasenotes/notes/plan-stack-cli-59b3f3a213ded859.yaml | 6 ++++++ scripts/tripleo-ansible-inventory | 9 +++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/plan-stack-cli-59b3f3a213ded859.yaml diff --git a/releasenotes/notes/plan-stack-cli-59b3f3a213ded859.yaml b/releasenotes/notes/plan-stack-cli-59b3f3a213ded859.yaml new file mode 100644 index 000000000..8148a46fb --- /dev/null +++ b/releasenotes/notes/plan-stack-cli-59b3f3a213ded859.yaml @@ -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. diff --git a/scripts/tripleo-ansible-inventory b/scripts/tripleo-ansible-inventory index e84a798b6..bd1b81662 100755 --- a/scripts/tripleo-ansible-inventory +++ b/scripts/tripleo-ansible-inventory @@ -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: