Skip to content

Commit

Permalink
Closes-Bug: #1640064 Pass the macaddress to the interface_setup.py sc…
Browse files Browse the repository at this point in the history
…ript if it is given as the inteface can

                     get renamed after reboot

Change-Id: I4f39dacbc4b88b4f512fba1323fd4fee86040699
  • Loading branch information
sgurumurthy committed Nov 14, 2016
1 parent c0c3691 commit 1a151ba
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/server_mgr_main.py
Expand Up @@ -3443,6 +3443,7 @@ def build_server_cfg(self, server):
device_str = "#!/bin/bash\n"
for intf in interface_list:
name = intf['name']
intf_name = name
ip_addr = intf.get('ip_address', None)
if ip_addr is None:
continue
Expand Down Expand Up @@ -3473,13 +3474,14 @@ def build_server_cfg(self, server):
(name, " ".join(member_intfs), json.dumps(bond_opts), ip_addr)
execute_script = True
else:
if 'name' not in intf and 'mac_address' in intf:
#Take the mac_address as the name as the interface may be renamed after reboot
if 'mac_address' in intf:
name = intf['mac_address'].lower()
if dhcp:
device_str+= ("python /root/interface_setup.py --device %s --dhcp\n") %(name)
else:
#For static managment interface pass the default gateway
if (mgmt_intf == name) and d_gw:
if (mgmt_intf == intf_name) and d_gw:
device_str+= ("python /root/interface_setup.py --device %s --ip %s --gw %s\n") % \
(name, ip_addr, d_gw)
else:
Expand Down

0 comments on commit 1a151ba

Please sign in to comment.