Skip to content

Commit

Permalink
Merge "Closes-Bug: #1639351 Configure default-gateway for bonded inte…
Browse files Browse the repository at this point in the history
…rfaces if it is specified in the json file" into R3.2
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Nov 5, 2016
2 parents b119cee + a70a9a6 commit 55b2e5a
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions src/server_mgr_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3457,21 +3457,32 @@ def build_server_cfg(self, server):
bond_opts = intf.get('bond_options', {})
member_intfs = self.get_member_interfaces(network_dict,
intf.get('member_interfaces', []))
device_str+= ("python /root/interface_setup.py \
--device %s --members %s --bond-opts \"%s\" --ip %s %s\n") % \
(name,
" ".join(member_intfs),
json.dumps(bond_opts), ip_addr, mtu)
if d_gw:
device_str+= ("python /root/interface_setup.py \
--device %s --members %s --bond-opts \"%s\" --ip %s --gw %s\n") % \
(name, " ".join(member_intfs), json.dumps(bond_opts), ip_addr, d_gw)
else:
device_str+= ("python /root/interface_setup.py \
--device %s --members %s --bond-opts \"%s\" --ip %s\n") % \
(name, " ".join(member_intfs), json.dumps(bond_opts), ip_addr)
execute_script = True
else:
if 'mac_address' in intf:
name = intf['mac_address'].lower()
if dhcp:
device_str+= ("python /root/interface_setup.py --device %s --dhcp %s\n") % \
(name, mtu)
if d_gw:
device_str+= ("python /root/interface_setup.py --device %s --gw %s --dhcp\n") % \
(name, d_gw)
else:
device_str+= ("python /root/interface_setup.py --device %s --dhcp\n") % \
(name)
else:
device_str+= ("python /root/interface_setup.py --device %s --ip %s --gw %s %s\n") % \
(name, ip_addr, d_gw, mtu)
if d_gw:
device_str+= ("python /root/interface_setup.py --device %s --ip %s --gw %s\n") % \
(name, ip_addr, d_gw)
else:
device_str+= ("python /root/interface_setup.py --device %s --ip %s\n") % \
(name, ip_addr)
execute_script = True
# Build route configuration and add it
route_str = self.build_route_cfg(server)
Expand Down

0 comments on commit 55b2e5a

Please sign in to comment.