Avoid invalid group characters in default inventory script factory

This commit is contained in:
Alan Rominger 2020-11-18 10:16:08 -05:00
parent b338da40c5
commit 91eff51390
No known key found for this signature in database
GPG Key ID: C2D7EAAA12B63559

View File

@ -231,7 +231,7 @@ class InventoryScript(HasCopy, HasCreate, base.Base):
'inventory["{0}"]["vars"] = dict(ansible_host="127.0.0.1", ansible_connection="local")',
'print(json.dumps(inventory))'
])
group_name = re.sub(r"[\']", "", "group-{}".format(random_utf8()))
group_name = re.sub(r"[\']", "", "group_{}".format(random_title(non_ascii=False)))
host_names = [
re.sub(
r"[\':]",