summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToshio Kuratomi <toshio@fedoraproject.org>2014-12-16 09:20:11 -0800
committerToshio Kuratomi <toshio@fedoraproject.org>2014-12-16 09:20:11 -0800
commitfbadcfd44fb86752abd19616cb56acb25b89cae4 (patch)
treef52db81d86d49e45203dd83237b1b17e7df3178c
parent27d2539fcd3e215d3c3a91a9f17ce4b80690d001 (diff)
downloadansible-fbadcfd44fb86752abd19616cb56acb25b89cae4.tar.gz
Fix for not all platforms having optional libraries at the proper versions.
-rwxr-xr-xbin/ansible11
-rwxr-xr-xbin/ansible-playbook10
-rwxr-xr-xbin/ansible-vault10
3 files changed, 29 insertions, 2 deletions
diff --git a/bin/ansible b/bin/ansible
index b82a18d3d3..7ba615dbc0 100755
--- a/bin/ansible
+++ b/bin/ansible
@@ -19,6 +19,17 @@
########################################################
+__requires__ = ['ansible']
+try:
+ import pkg_resources
+except Exception:
+ # Use pkg_resources to find the correct versions of libraries and set
+ # sys.path appropriately when there are multiversion installs. But we
+ # have code that better expresses the errors in the places where the code
+ # is actually used (the deps are optional for many code paths) so we don't
+ # want to fail here.
+ pass
+
import os
import sys
diff --git a/bin/ansible-playbook b/bin/ansible-playbook
index 93645903f7..d25a3710d8 100755
--- a/bin/ansible-playbook
+++ b/bin/ansible-playbook
@@ -19,7 +19,15 @@
#######################################################
__requires__ = ['ansible']
-import pkg_resources
+try:
+ import pkg_resources
+except Exception:
+ # Use pkg_resources to find the correct versions of libraries and set
+ # sys.path appropriately when there are multiversion installs. But we
+ # have code that better expresses the errors in the places where the code
+ # is actually used (the deps are optional for many code paths) so we don't
+ # want to fail here.
+ pass
import sys
import os
diff --git a/bin/ansible-vault b/bin/ansible-vault
index 3079b31d9e..22cfc0e148 100755
--- a/bin/ansible-vault
+++ b/bin/ansible-vault
@@ -19,7 +19,15 @@
# http://docs.ansible.com/playbooks_vault.html for more details.
__requires__ = ['ansible']
-import pkg_resources
+try:
+ import pkg_resources
+except Exception:
+ # Use pkg_resources to find the correct versions of libraries and set
+ # sys.path appropriately when there are multiversion installs. But we
+ # have code that better expresses the errors in the places where the code
+ # is actually used (the deps are optional for many code paths) so we don't
+ # want to fail here.
+ pass
import os
import sys