diff options
author | Michael Scherer <misc@zarb.org> | 2016-10-18 18:14:02 +0200 |
---|---|---|
committer | Michael Scherer <mscherer@users.noreply.github.com> | 2016-10-19 01:04:10 +0200 |
commit | d439271f685c01ace04025f27e7046dd35d988f8 (patch) | |
tree | c3171628606728f5af029fdac015c10c2d684759 /network | |
parent | 3f77bb6857243992f95316e3cd37d01e7f229d64 (diff) | |
download | ansible-modules-extras-d439271f685c01ace04025f27e7046dd35d988f8.tar.gz |
Make openvswitch* pass py3 sanity check
Diffstat (limited to 'network')
-rw-r--r-- | network/openvswitch_bridge.py | 7 | ||||
-rw-r--r-- | network/openvswitch_port.py | 7 |
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() |