From b0b09a65b68fa0297538bfbcc40c15655617721e Mon Sep 17 00:00:00 2001 From: Dan Sneddon Date: Tue, 8 Mar 2016 16:35:33 -0800 Subject: Fix hierarchy for Linux Bonds and Linux Bridges This change cleans up some of the Linux Bond and Linux Bridge logic that processes member interfaces and VLANs. One bug is fixed, where a VLAN might be assigned as a slave interface on a bond. Changes were made so that if VLANs are placed under a Linux Bond, the PHYSDEV is set to the bond, so the device: does not need to be specified in the config. This change ensures that if a bridge has a bond and VLANs as members, that the VLAN will be a member of the bridge and not the bond. Change-Id: Id329737f0032e781b111741086ded83f378297a7 --- os_net_config/impl_ifcfg.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'os_net_config/impl_ifcfg.py') diff --git a/os_net_config/impl_ifcfg.py b/os_net_config/impl_ifcfg.py index c4d6d93..7f8ad96 100644 --- a/os_net_config/impl_ifcfg.py +++ b/os_net_config/impl_ifcfg.py @@ -89,6 +89,9 @@ class IfcfgNetConfig(os_net_config.NetConfig): data += "VLAN=yes\n" if base_opt.device: data += "PHYSDEV=%s\n" % base_opt.device + else: + if base_opt.linux_bond_name: + data += "PHYSDEV=%s\n" % base_opt.linux_bond_name elif isinstance(base_opt, objects.IvsInterface): data += "TYPE=IVSIntPort\n" elif re.match('\w+\.\d+$', base_opt.name): @@ -163,7 +166,8 @@ class IfcfgNetConfig(os_net_config.NetConfig): members = [member.name for member in base_opt.members] self.member_names[base_opt.name] = members for member in members: - self.bond_slaves[member] = base_opt.name + if isinstance(member, objects.Interface): + self.bond_slaves[member] = base_opt.name if base_opt.bonding_options: data += "BONDING_OPTS=\"%s\"\n" % base_opt.bonding_options else: -- cgit 1.2.3-korg