Skip to content

Commit

Permalink
Dont assume vlan tag of control+data interface would be same across a…
Browse files Browse the repository at this point in the history
…ll nodes

Closes-Bug: #1456144

Change-Id: I303970b0d8fbb38fe3d64a9f038821cd5fd696da
  • Loading branch information
msenthil committed May 22, 2015
1 parent 0cc03a0 commit c78eebf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion fabfile/tasks/provision.py
Original file line number Diff line number Diff line change
Expand Up @@ -2189,7 +2189,7 @@ def add_static_route_node(*args):
dest = ' --network'; gw = ' --gw'; netmask = ' --netmask'
device = route_info[tgt_host][0]['intf']
intf = ' --device %s' %device
vlan = get_vlan_tag(device)
vlan = get_vlan_tag(device, tgt_host)
for index in range(len(route_info[tgt_host])):
dest += ' %s' %route_info[tgt_host][index]['ip']
gw += ' %s' %route_info[tgt_host][index]['gw']
Expand Down
9 changes: 4 additions & 5 deletions fabfile/utils/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,9 @@ def get_data_ip(host_str):
return (tgt_ip, tgt_gw)
#end get_data_ip

def get_vlan_tag(device):
def get_vlan_tag(device, host):
hosts = getattr(testbed, 'control_data', None)
if hosts:
for host in hosts.keys():
if hosts[host]['device'] == device and hosts[host].has_key('vlan'):
return hosts[host]['vlan']
if hosts and host in hosts:
if hosts[host]['device'] == device and hosts[host].has_key('vlan'):
return hosts[host]['vlan']
return None

0 comments on commit c78eebf

Please sign in to comment.