summaryrefslogtreecommitdiff
path: root/network
diff options
context:
space:
mode:
Diffstat (limited to 'network')
-rw-r--r--network/openvswitch_bridge.py7
-rw-r--r--network/openvswitch_port.py7
2 files changed, 10 insertions, 4 deletions
diff --git a/network/openvswitch_bridge.py b/network/openvswitch_bridge.py
index 68528dd4..abe89dfd 100644
--- a/network/openvswitch_bridge.py
+++ b/network/openvswitch_bridge.py
@@ -143,7 +143,8 @@ class OVSBridge(object):
changed = True
elif self.state == 'present' and not self.exists():
changed = True
- except Exception, earg:
+ except Exception:
+ earg = get_exception()
self.module.fail_json(msg=str(earg))
# pylint: enable=W0703
@@ -189,7 +190,8 @@ class OVSBridge(object):
self.set_external_id(key, None)):
changed = True
- except Exception, earg:
+ except Exception:
+ earg = get_exception()
self.module.fail_json(msg=str(earg))
# pylint: enable=W0703
self.module.exit_json(changed=changed)
@@ -267,4 +269,5 @@ def main():
# import module snippets
from ansible.module_utils.basic import *
+from ansible.module_utils.pycompat24 import get_exception
main()
diff --git a/network/openvswitch_port.py b/network/openvswitch_port.py
index c2224b52..d2bf31a7 100644
--- a/network/openvswitch_port.py
+++ b/network/openvswitch_port.py
@@ -204,7 +204,8 @@ class OVSPort(object):
changed = True
else:
changed = False
- except Exception, earg:
+ except Exception:
+ earg = get_exception()
self.module.fail_json(msg=str(earg))
self.module.exit_json(changed=changed)
@@ -235,7 +236,8 @@ class OVSPort(object):
external_id = fmt_opt % (self.port, key, value)
changed = self.set(external_id) or changed
##
- except Exception, earg:
+ except Exception:
+ earg = get_exception()
self.module.fail_json(msg=str(earg))
self.module.exit_json(changed=changed)
@@ -269,4 +271,5 @@ def main():
# import module snippets
from ansible.module_utils.basic import *
+from ansible.module_utils.pycompat24 import get_exception
main()