From 354383874f9accfd265dd290a2377477414073ca Mon Sep 17 00:00:00 2001 From: Florian Apolloner Date: Wed, 7 Oct 2015 11:37:23 +0200 Subject: [PATCH] Show a nice error if the role name is missing. --- lib/ansible/cli/galaxy.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/cli/galaxy.py b/lib/ansible/cli/galaxy.py index 60970929ac1..3903275a2f0 100644 --- a/lib/ansible/cli/galaxy.py +++ b/lib/ansible/cli/galaxy.py @@ -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):