Skip to content
Snippets Groups Projects
Commit 46dfe9bd authored by ale's avatar ale
Browse files

Improve error handling of --additional-host-group options

parent b02a3496
No related branches found
No related tags found
No related merge requests found
Pipeline #64307 passed
......@@ -364,14 +364,13 @@ def command_create_env(path, services, passwords, playbooks,
# Catch ValueError to handle parsing errors for composite-valued
# options and print a friendly message.
try:
all_vars['inventory']['hosts'] = _random_hosts(
num_hosts,
_parse_additional_host_groups(additional_host_groups),
)
extra_memberships = _parse_additional_host_groups(additional_host_groups)
except ValueError:
print('Unable to parse additional-host-group spec', file=sys.stderr)
return 1
all_vars['inventory']['hosts'] = _random_hosts(num_hosts, extra_memberships)
all_vars['ram'] = ram
all_vars['config']['domain_public'] = [domain]
all_vars['config']['domain'] = (
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment