openvswitch_bridge: Check VLAN ID only under fake bridge (#3374)

This commit is contained in:
Kei Nohguchi 2016-11-09 12:10:15 -08:00 committed by Matt Clay
parent 6cfb44b4bb
commit cc95bc4935

View file

@ -101,11 +101,11 @@ class OVSBridge(object):
self.timeout = module.params['timeout'] self.timeout = module.params['timeout']
self.fail_mode = module.params['fail_mode'] self.fail_mode = module.params['fail_mode']
if self.parent and self.vlan is None: if self.parent:
self.module.fail_json(msg='VLAN id must be set when parent is defined') if 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: elif self.vlan < 0 or self.vlan > 4095:
self.module.fail_json(msg='Invalid VLAN ID (must be between 0 and 4095)') self.module.fail_json(msg='Invalid VLAN ID (must be between 0 and 4095)')
def _vsctl(self, command): def _vsctl(self, command):
'''Run ovs-vsctl command''' '''Run ovs-vsctl command'''