From 56a2412dc2da760d0f481b16eba88556d9b26fda Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Mon, 2 Nov 2015 12:46:04 -0500 Subject: [PATCH] now correctly traps unimplemented symlinks as subprograms --- bin/ansible | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/bin/ansible b/bin/ansible index 70e6863f6bf..085a8e0f4e6 100755 --- a/bin/ansible +++ b/bin/ansible @@ -74,12 +74,13 @@ if __name__ == '__main__': elif me == 'ansible-galaxy': from ansible.cli.galaxy import GalaxyCLI as mycli - cli = mycli(sys.argv, display=display) - if cli: - cli.parse() - sys.exit(cli.run()) - else: - raise AnsibleError("Program not implemented: %s" % me) + try: + cli = mycli(sys.argv, display=display) + except NameError: + raise AnsibleError("Ansible sub-program not implemented: %s" % me) + + cli.parse() + sys.exit(cli.run()) except AnsibleOptionsError as e: cli.parser.print_help()