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
parent caefe31125
commit 6bd0fbb63c
42 changed files with 284 additions and 409 deletions

View File

@@ -83,8 +83,7 @@ RETURN = '''
'''
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.basic import get_exception
from ansible.module_utils._text import to_native
try:
import pan.xapi
@@ -171,14 +170,14 @@ def main():
try:
changed = add_dhcp_if(xapi, if_name, zone_name, create_default_route)
except PanXapiError:
exc = get_exception()
module.fail_json(msg=exc.message)
except PanXapiError as exc:
module.fail_json(msg=to_native(exc))
if changed and commit:
xapi.commit(cmd="<commit></commit>", sync=True, interval=1)
module.exit_json(changed=changed, msg="okey dokey")
if __name__ == '__main__':
main()