From 1ef0287854e139fd483a43bd10e97f82afdca40d Mon Sep 17 00:00:00 2001 From: Peter Sprygada Date: Wed, 22 Feb 2017 19:31:36 -0500 Subject: [PATCH] casts the bridge id to a str prior to building command (#21805) This will prevent exception from being raise when calling _vsctl and extending the cmd with the bridge information --- lib/ansible/modules/network/ovs/openvswitch_bridge.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/network/ovs/openvswitch_bridge.py b/lib/ansible/modules/network/ovs/openvswitch_bridge.py index 82a13dde60c..e172f73397e 100644 --- a/lib/ansible/modules/network/ovs/openvswitch_bridge.py +++ b/lib/ansible/modules/network/ovs/openvswitch_bridge.py @@ -193,7 +193,7 @@ class OVSBridge(object): '''Create the bridge''' cmd = ['add-br', self.bridge] if self.parent and self.vlan: # Add fake bridge - cmd += [self.parent, self.vlan] + cmd += [self.parent, str(self.vlan)] if self.set and self.set_opt: cmd += ["--", "set"] @@ -296,6 +296,7 @@ class OVSBridge(object): changed = True except Exception: + raise earg = get_exception() self.module.fail_json(msg=str(earg)) # pylint: enable=W0703