mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Fix bin/ansible to not make a double traceback on python3 (#15972)
This commit is contained in:
parent
805e0ec529
commit
f0023610e8
1 changed files with 6 additions and 1 deletions
|
@ -82,7 +82,12 @@ if __name__ == '__main__':
|
||||||
else:
|
else:
|
||||||
raise AnsibleError("Unknown Ansible alias: %s" % me)
|
raise AnsibleError("Unknown Ansible alias: %s" % me)
|
||||||
except ImportError as e:
|
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)
|
raise AnsibleError("Ansible sub-program not implemented: %s" % me)
|
||||||
else:
|
else:
|
||||||
raise
|
raise
|
||||||
|
|
Loading…
Reference in a new issue