diff options
author | Michael Scherer <mscherer@users.noreply.github.com> | 2016-06-02 18:49:22 +0200 |
---|---|---|
committer | Toshio Kuratomi <a.badger@gmail.com> | 2016-06-02 09:49:22 -0700 |
commit | f0023610e844d006bd54709177027618632e3ecf (patch) | |
tree | fa480afe3c0f10dbcead3e53872cba3fbed0f419 /bin | |
parent | 805e0ec529f7f9bf34fa9d930710e4432211362d (diff) | |
download | ansible-f0023610e844d006bd54709177027618632e3ecf.tar.gz |
Fix bin/ansible to not make a double traceback on python3 (#15972)
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/ansible | 7 |
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 |