From cc95bc4935882f87853d2e7995674a7154866c6d Mon Sep 17 00:00:00 2001 From: Kei Nohguchi Date: Wed, 9 Nov 2016 12:10:15 -0800 Subject: [PATCH] openvswitch_bridge: Check VLAN ID only under fake bridge (#3374) --- .../modules/extras/network/openvswitch_bridge.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/ansible/modules/extras/network/openvswitch_bridge.py b/lib/ansible/modules/extras/network/openvswitch_bridge.py index fe48ca99a2..b52df601c2 100644 --- a/lib/ansible/modules/extras/network/openvswitch_bridge.py +++ b/lib/ansible/modules/extras/network/openvswitch_bridge.py @@ -101,11 +101,11 @@ class OVSBridge(object): self.timeout = module.params['timeout'] self.fail_mode = module.params['fail_mode'] - if self.parent and self.vlan is None: - self.module.fail_json(msg='VLAN id must be set when parent is defined') - - if self.vlan < 0 or self.vlan > 4095: - self.module.fail_json(msg='Invalid VLAN ID (must be between 0 and 4095)') + if self.parent: + if self.vlan is None: + self.module.fail_json(msg='VLAN id must be set when parent is defined') + elif self.vlan < 0 or self.vlan > 4095: + self.module.fail_json(msg='Invalid VLAN ID (must be between 0 and 4095)') def _vsctl(self, command): '''Run ovs-vsctl command'''