Skip to content

Commit

Permalink
capture some install issues and give out a slightly nicer error
Browse files Browse the repository at this point in the history
  • Loading branch information
bcoca committed Oct 27, 2015
1 parent 46acf89 commit e6b1dc4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions bin/ansible
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit e6b1dc4

Please sign in to comment.