summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorBrian Coca <brian.coca+git@gmail.com>2015-10-27 19:30:01 +0100
committerBrian Coca <brian.coca+git@gmail.com>2015-10-28 00:59:43 +0100
commite6b1dc45e1f8fb0040579622239d26eddf65aefe (patch)
tree7299755a09b4ac1254d4c2a9ca6f47a7c05dd060 /bin
parentclarified ignore_errors (diff)
downloadansible-e6b1dc45e1f8fb0040579622239d26eddf65aefe.tar.xz
ansible-e6b1dc45e1f8fb0040579622239d26eddf65aefe.zip
capture some install issues and give out a slightly nicer error
Diffstat (limited to 'bin')
-rwxr-xr-xbin/ansible5
1 files changed, 5 insertions, 0 deletions
diff --git a/bin/ansible b/bin/ansible
index 70e6863f6b..7cd76e4550 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)