mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
Fixing white space issue with cmd, and making internal default to False
This commit is contained in:
parent
43b2bec26f
commit
64b64f9ee7
@ -335,7 +335,7 @@ def interface_get_type(port):
|
||||
return _stdout_list_split(retcode, stdout)
|
||||
|
||||
|
||||
def port_create_vlan(br, port, id, internal):
|
||||
def port_create_vlan(br, port, id, internal=False):
|
||||
'''
|
||||
Isolate VM traffic using VLANs.
|
||||
|
||||
@ -364,14 +364,14 @@ def port_create_vlan(br, port, id, internal):
|
||||
return False
|
||||
elif port in port_list(br):
|
||||
cmd = 'ovs-vsctl set port {0} tag={1}'.format(port, id)
|
||||
if internal:
|
||||
cmd += ' -- set interface {0} type=internal'.format(port)
|
||||
if internal:
|
||||
cmd += ' -- set interface {0} type=internal'.format(port)
|
||||
result = __salt__['cmd.run_all'](cmd)
|
||||
return _retcode_to_bool(result['retcode'])
|
||||
else:
|
||||
cmd = 'ovs-vsctl add-port {0} {1} tag={2}'.format(br, port, id)
|
||||
if internal:
|
||||
cmd += ' -- set interface {0} type=internal'.format(port)
|
||||
if internal:
|
||||
cmd += ' -- set interface {0} type=internal'.format(port)
|
||||
result = __salt__['cmd.run_all'](cmd)
|
||||
return _retcode_to_bool(result['retcode'])
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user