summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorMichael Scherer <mscherer@users.noreply.github.com>2016-06-02 18:49:22 +0200
committerToshio Kuratomi <a.badger@gmail.com>2016-06-02 09:49:22 -0700
commitf0023610e844d006bd54709177027618632e3ecf (patch)
treefa480afe3c0f10dbcead3e53872cba3fbed0f419 /bin
parent805e0ec529f7f9bf34fa9d930710e4432211362d (diff)
downloadansible-f0023610e844d006bd54709177027618632e3ecf.tar.gz
Fix bin/ansible to not make a double traceback on python3 (#15972)
Diffstat (limited to 'bin')
-rwxr-xr-xbin/ansible7
1 files changed, 6 insertions, 1 deletions
diff --git a/bin/ansible b/bin/ansible
index 59b4fec305..58b4b1bf86 100755
--- a/bin/ansible
+++ b/bin/ansible
@@ -82,7 +82,12 @@ if __name__ == '__main__':
else:
raise AnsibleError("Unknown Ansible alias: %s" % me)
except ImportError as e:
- if e.message.endswith(' %s' % sub):
+ # ImportError members have changed in py3
+ if 'msg' in dir(e):
+ msg = e.msg
+ else:
+ msg = e.message
+ if msg.endswith(' %s' % sub):
raise AnsibleError("Ansible sub-program not implemented: %s" % me)
else:
raise