1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Show a nice error if the role name is missing.

This commit is contained in:
Florian Apolloner 2015-10-07 11:37:23 +02:00
parent 9e364c2eb5
commit 354383874f

View file

@ -167,8 +167,8 @@ class GalaxyCLI(CLI):
force = self.get_opt('force', False)
offline = self.get_opt('offline', False)
role_name = self.args.pop(0).strip()
if role_name == "":
role_name = self.args.pop(0).strip() if self.args else None
if not role_name:
raise AnsibleOptionsError("- no role name specified for init")
role_path = os.path.join(init_path, role_name)
if os.path.exists(role_path):