From e0b180e13543682b0196c96e39f103cbbae697dc Mon Sep 17 00:00:00 2001 From: Pierre Riteau Date: Fri, 2 Apr 2021 14:31:15 +0200 Subject: [PATCH] Fix help texts of inventory options Passing the Kayobe or Kolla Ansible inventories as comma-separated host list was never supported since we check that inventory directories exist. Also fix the check for the Kolla Ansible inventory directory, which was using the wrong variable (parsed_args.kolla_venv). Change-Id: I215f927d8249aadd9cc7bb44893e0bdf5f26510a --- kayobe/ansible.py | 3 +-- kayobe/kolla_ansible.py | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/kayobe/ansible.py b/kayobe/ansible.py index d129b4b65..788c8a901 100644 --- a/kayobe/ansible.py +++ b/kayobe/ansible.py @@ -58,8 +58,7 @@ def add_args(parser): parser.add_argument("-i", "--inventory", metavar="INVENTORY", action="append", help="specify inventory host path " - "(default=$%s/inventory or %s/inventory) or " - "comma-separated host list" % + "(default=$%s/inventory or %s/inventory) " % (CONFIG_PATH_ENV, DEFAULT_CONFIG_PATH)) parser.add_argument("-l", "--limit", metavar="SUBSET", help="further limit selected hosts to an additional " diff --git a/kayobe/kolla_ansible.py b/kayobe/kolla_ansible.py index 38dd35ef9..8954dae07 100644 --- a/kayobe/kolla_ansible.py +++ b/kayobe/kolla_ansible.py @@ -50,8 +50,8 @@ def add_args(parser): "YAML/JSON for Kolla Ansible") parser.add_argument("-ki", "--kolla-inventory", metavar="INVENTORY", help="specify inventory host path " - "(default=$%s/inventory or %s/inventory) or " - "comma-separated host list for Kolla Ansible" % + "(default=$%s/inventory or %s/inventory) for " + "Kolla Ansible" % (CONFIG_PATH_ENV, DEFAULT_CONFIG_PATH)) parser.add_argument("-kl", "--kolla-limit", metavar="SUBSET", help="further limit selected hosts to an additional " @@ -87,7 +87,7 @@ def _validate_args(parsed_args, inventory_filename): sys.exit(1) inventory = _get_inventory_path(parsed_args, inventory_filename) - result = utils.is_readable_dir(parsed_args.kolla_venv) + result = utils.is_readable_dir(inventory) if not result["result"]: # NOTE(mgoddard): Previously the inventory was a file, now it is a # directory to allow us to support inventory host_vars. Support both