Skip to content

Commit

Permalink
Make openvswitch* pass py3 sanity check
Browse files Browse the repository at this point in the history
  • Loading branch information
mscherer authored and mattclay committed Dec 8, 2016
1 parent 2a83eef commit 7f4fdba
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
7 changes: 5 additions & 2 deletions lib/ansible/modules/extras/network/openvswitch_bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ def check(self):
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
Expand Down Expand Up @@ -189,7 +190,8 @@ def run(self):
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)
Expand Down Expand Up @@ -267,4 +269,5 @@ def main():

# import module snippets
from ansible.module_utils.basic import *
from ansible.module_utils.pycompat24 import get_exception
main()
7 changes: 5 additions & 2 deletions lib/ansible/modules/extras/network/openvswitch_port.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,8 @@ def check(self):
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)

Expand Down Expand Up @@ -235,7 +236,8 @@ def run(self):
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)

Expand Down Expand Up @@ -269,4 +271,5 @@ def main():

# import module snippets
from ansible.module_utils.basic import *
from ansible.module_utils.pycompat24 import get_exception
main()
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,3 @@
/network/f5/bigip_gtm_virtual_server.py
/network/f5/bigip_gtm_wide_ip.py
/network/nmcli.py
/network/openvswitch_bridge.py
/network/openvswitch_port.py

0 comments on commit 7f4fdba

Please sign in to comment.