mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00:00
Remove deprecated get_exception API
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
committed by
Brian Coca
parent
caefe31125
commit
6bd0fbb63c
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user