Remove deprecated get_exception API

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
Abhijeet Kasurde 2017-12-26 08:33:21 +05:30 committed by Brian Coca
commit 6bd0fbb63c
42 changed files with 284 additions and 409 deletions

View file

@ -130,7 +130,7 @@ acl:
import os
from ansible.module_utils.basic import AnsibleModule, get_platform
from ansible.module_utils.pycompat24 import get_exception
from ansible.module_utils._text import to_native
def split_entry(entry):
@ -225,9 +225,8 @@ def run_acl(module, cmd, check_rc=True):
try:
(rc, out, err) = module.run_command(' '.join(cmd), check_rc=check_rc)
except Exception:
e = get_exception()
module.fail_json(msg=e.strerror)
except Exception as e:
module.fail_json(msg=to_native(e))
lines = []
for l in out.splitlines():
@ -355,5 +354,6 @@ def main():
module.exit_json(changed=changed, msg=msg, acl=acl)
if __name__ == '__main__':
main()