From e6b1dc45e1f8fb0040579622239d26eddf65aefe Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Tue, 27 Oct 2015 14:30:01 -0400 Subject: [PATCH] capture some install issues and give out a slightly nicer error --- bin/ansible | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bin/ansible b/bin/ansible index 70e6863f6bf..7cd76e45507 100755 --- a/bin/ansible +++ b/bin/ansible @@ -36,6 +36,8 @@ import os import sys import traceback +from pkg_resources import DistributionNotFound + from ansible.errors import AnsibleError, AnsibleOptionsError, AnsibleParserError from ansible.utils.display import Display from ansible.utils.unicode import to_unicode @@ -98,6 +100,9 @@ if __name__ == '__main__': except AnsibleError as e: display.error(to_unicode(e), wrap_text=False) sys.exit(1) + except DistributionNotFound as e: + display.error("There is an issue with the Ansible installation: %s" % to_unicode(e)) + sys.exit(10) except KeyboardInterrupt: display.error("User interrupted execution") sys.exit(99)