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
(cherry picked from commit e0b180e135)
This commit is contained in:
Pierre Riteau 2021-04-02 14:31:15 +02:00
parent d64d415fac
commit d8f640f1ba
2 changed files with 4 additions and 5 deletions

View File

@ -51,8 +51,7 @@ def add_args(parser):
"YAML/JSON")
parser.add_argument("-i", "--inventory", metavar="INVENTORY",
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 "

View File

@ -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