1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

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.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'''