Restore the order of params in ifcfg file that was inadvertently changed
This change to os-net-config in Queens changed the order of the ONBOOT parameter in the ifcg files created by os-net-config - https://review.openstack.org/#/c/485132/. When upgrading a diff is done between the existing ifcfg files and new data to write. Since the order is different, the ifcg files will be detected as different and interfaces, bridges, etc. will be restarted. Change the order back to avoid this from happening. Change-Id: I77162d28b1dc173e3a90cb385a3af92e21c71574
This commit is contained in:
parent
e78b09635c
commit
9084bb5e57
|
@ -143,14 +143,14 @@ class IfcfgNetConfig(os_net_config.NetConfig):
|
|||
|
||||
data = "# This file is autogenerated by os-net-config\n"
|
||||
data += "DEVICE=%s\n" % base_opt.name
|
||||
if isinstance(base_opt, objects.Interface) and base_opt.hotplug:
|
||||
data += "HOTPLUG=yes\n"
|
||||
else:
|
||||
data += "HOTPLUG=no\n"
|
||||
if base_opt.onboot:
|
||||
data += "ONBOOT=yes\n"
|
||||
else:
|
||||
data += "ONBOOT=no\n"
|
||||
if isinstance(base_opt, objects.Interface) and base_opt.hotplug:
|
||||
data += "HOTPLUG=yes\n"
|
||||
else:
|
||||
data += "HOTPLUG=no\n"
|
||||
if base_opt.nm_controlled:
|
||||
data += "NM_CONTROLLED=yes\n"
|
||||
else:
|
||||
|
|
|
@ -29,24 +29,24 @@ from os_net_config import utils
|
|||
|
||||
_BASE_IFCFG = """# This file is autogenerated by os-net-config
|
||||
DEVICE=em1
|
||||
HOTPLUG=no
|
||||
ONBOOT=yes
|
||||
HOTPLUG=no
|
||||
NM_CONTROLLED=no
|
||||
PEERDNS=no
|
||||
"""
|
||||
|
||||
_BASE_IFCFG_NETWORKMANAGER = """# This file is autogenerated by os-net-config
|
||||
DEVICE=em1
|
||||
HOTPLUG=no
|
||||
ONBOOT=yes
|
||||
HOTPLUG=no
|
||||
NM_CONTROLLED=yes
|
||||
PEERDNS=no
|
||||
"""
|
||||
|
||||
_HOTPLUG = """# This file is autogenerated by os-net-config
|
||||
DEVICE=em1
|
||||
HOTPLUG=yes
|
||||
ONBOOT=yes
|
||||
HOTPLUG=yes
|
||||
NM_CONTROLLED=no
|
||||
PEERDNS=no
|
||||
BOOTPROTO=none
|
||||
|
@ -54,8 +54,8 @@ BOOTPROTO=none
|
|||
|
||||
_ONBOOT = """# This file is autogenerated by os-net-config
|
||||
DEVICE=em1
|
||||
HOTPLUG=no
|
||||
ONBOOT=yes
|
||||
HOTPLUG=no
|
||||
NM_CONTROLLED=no
|
||||
PEERDNS=no
|
||||
BOOTPROTO=none
|
||||
|
@ -78,8 +78,8 @@ IPV6ADDR=2001:abc:a::/64
|
|||
|
||||
_IFCFG_VLAN = """# This file is autogenerated by os-net-config
|
||||
DEVICE=em1.120
|
||||
HOTPLUG=no
|
||||
ONBOOT=yes
|
||||
HOTPLUG=no
|
||||
NM_CONTROLLED=no
|
||||
PEERDNS=no
|
||||
VLAN=yes
|
||||
|
@ -91,8 +91,8 @@ _V4_IFCFG_MAPPED = _V4_IFCFG.replace('em1', 'nic1') + "HWADDR=a1:b2:c3:d4:e5\n"
|
|||
|
||||
_BASE_IB_IFCFG = """# This file is autogenerated by os-net-config
|
||||
DEVICE=ib0
|
||||
HOTPLUG=no
|
||||
ONBOOT=yes
|
||||
HOTPLUG=no
|
||||
NM_CONTROLLED=no
|
||||
PEERDNS=no
|
||||
TYPE=Infiniband
|
||||
|
@ -127,8 +127,8 @@ _OVS_IFCFG = _BASE_IFCFG + "DEVICETYPE=ovs\nBOOTPROTO=none\n"
|
|||
|
||||
_OVS_IFCFG_TUNNEL = """# This file is autogenerated by os-net-config
|
||||
DEVICE=tun0
|
||||
HOTPLUG=no
|
||||
ONBOOT=yes
|
||||
HOTPLUG=no
|
||||
NM_CONTROLLED=no
|
||||
PEERDNS=no
|
||||
DEVICETYPE=ovs
|
||||
|
@ -162,8 +162,8 @@ BOOTPROTO=none
|
|||
|
||||
_OVS_BRIDGE_DHCP = """# This file is autogenerated by os-net-config
|
||||
DEVICE=br-ctlplane
|
||||
HOTPLUG=no
|
||||
ONBOOT=yes
|
||||
HOTPLUG=no
|
||||
NM_CONTROLLED=no
|
||||
DEVICETYPE=ovs
|
||||
TYPE=OVSBridge
|
||||
|
@ -178,8 +178,8 @@ BOOTPROTO=none
|
|||
|
||||
_NM_CONTROLLED_BOND = """# This file is autogenerated by os-net-config
|
||||
DEVICE=bond1
|
||||
HOTPLUG=no
|
||||
ONBOOT=yes
|
||||
HOTPLUG=no
|
||||
NM_CONTROLLED=yes
|
||||
PEERDNS=no
|
||||
"""
|
||||
|
@ -194,8 +194,8 @@ _OVS_BRIDGE_DHCP_SECURE = _OVS_BRIDGE_DHCP + \
|
|||
|
||||
_LINUX_BRIDGE_DHCP = """# This file is autogenerated by os-net-config
|
||||
DEVICE=br-ctlplane
|
||||
HOTPLUG=no
|
||||
ONBOOT=yes
|
||||
HOTPLUG=no
|
||||
NM_CONTROLLED=no
|
||||
TYPE=Bridge
|
||||
DELAY=0
|
||||
|
@ -204,8 +204,8 @@ BOOTPROTO=dhcp
|
|||
|
||||
_OVS_BRIDGE_STATIC = """# This file is autogenerated by os-net-config
|
||||
DEVICE=br-ctlplane
|
||||
HOTPLUG=no
|
||||
ONBOOT=yes
|
||||
HOTPLUG=no
|
||||
NM_CONTROLLED=no
|
||||
PEERDNS=no
|
||||
DEVICETYPE=ovs
|
||||
|
@ -217,8 +217,8 @@ NETMASK=255.255.255.0
|
|||
|
||||
_LINUX_BRIDGE_STATIC = """# This file is autogenerated by os-net-config
|
||||
DEVICE=br-ctlplane
|
||||
HOTPLUG=no
|
||||
ONBOOT=yes
|
||||
HOTPLUG=no
|
||||
NM_CONTROLLED=no
|
||||
PEERDNS=no
|
||||
TYPE=Bridge
|
||||
|
@ -239,8 +239,8 @@ _OVS_BRIDGE_DHCP_OVS_EXTRA = _OVS_BRIDGE_DHCP + \
|
|||
|
||||
_BASE_VLAN = """# This file is autogenerated by os-net-config
|
||||
DEVICE=vlan5
|
||||
HOTPLUG=no
|
||||
ONBOOT=yes
|
||||
HOTPLUG=no
|
||||
NM_CONTROLLED=no
|
||||
PEERDNS=no
|
||||
VLAN=yes
|
||||
|
@ -250,8 +250,8 @@ PHYSDEV=em1
|
|||
# vlans on an OVS bridge do not set VLAN=yes or PHYSDEV
|
||||
_BASE_VLAN_OVS = """# This file is autogenerated by os-net-config
|
||||
DEVICE=vlan5
|
||||
HOTPLUG=no
|
||||
ONBOOT=yes
|
||||
HOTPLUG=no
|
||||
NM_CONTROLLED=no
|
||||
PEERDNS=no
|
||||
"""
|
||||
|
@ -277,8 +277,8 @@ BOOTPROTO=none
|
|||
|
||||
_OVS_BOND_DHCP = """# This file is autogenerated by os-net-config
|
||||
DEVICE=bond0
|
||||
HOTPLUG=no
|
||||
ONBOOT=yes
|
||||
HOTPLUG=no
|
||||
NM_CONTROLLED=no
|
||||
DEVICETYPE=ovs
|
||||
TYPE=OVSBond
|
||||
|
@ -288,8 +288,8 @@ BOND_IFACES="em1 em2"
|
|||
|
||||
_LINUX_BOND_DHCP = """# This file is autogenerated by os-net-config
|
||||
DEVICE=bond0
|
||||
HOTPLUG=no
|
||||
ONBOOT=yes
|
||||
HOTPLUG=no
|
||||
NM_CONTROLLED=no
|
||||
BOOTPROTO=dhcp
|
||||
"""
|
||||
|
@ -297,8 +297,8 @@ BOOTPROTO=dhcp
|
|||
|
||||
_LINUX_TEAM_DHCP = """# This file is autogenerated by os-net-config
|
||||
DEVICE=team0
|
||||
HOTPLUG=no
|
||||
ONBOOT=yes
|
||||
HOTPLUG=no
|
||||
NM_CONTROLLED=no
|
||||
BOOTPROTO=dhcp
|
||||
DEVICETYPE=Team
|
||||
|
@ -316,8 +316,8 @@ BOOTPROTO=none
|
|||
|
||||
_IVS_UPLINK = """# This file is autogenerated by os-net-config
|
||||
DEVICE=em1
|
||||
HOTPLUG=no
|
||||
ONBOOT=yes
|
||||
HOTPLUG=no
|
||||
NM_CONTROLLED=no
|
||||
PEERDNS=no
|
||||
DEVICETYPE=ivs
|
||||
|
@ -327,8 +327,8 @@ BOOTPROTO=none
|
|||
|
||||
_IVS_INTERFACE = """# This file is autogenerated by os-net-config
|
||||
DEVICE=storage5
|
||||
HOTPLUG=no
|
||||
ONBOOT=yes
|
||||
HOTPLUG=no
|
||||
NM_CONTROLLED=no
|
||||
PEERDNS=no
|
||||
TYPE=IVSIntPort
|
||||
|
@ -345,8 +345,8 @@ _IVS_CONFIG = ('DAEMON_ARGS=\"--hitless --certificate /etc/ivs '
|
|||
|
||||
_NFVSWITCH_INTERFACE = """# This file is autogenerated by os-net-config
|
||||
DEVICE=em1
|
||||
HOTPLUG=no
|
||||
ONBOOT=yes
|
||||
HOTPLUG=no
|
||||
NM_CONTROLLED=no
|
||||
PEERDNS=no
|
||||
DEVICETYPE=nfvswitch
|
||||
|
@ -356,8 +356,8 @@ BOOTPROTO=none
|
|||
|
||||
_NFVSWITCH_INTERNAL = """# This file is autogenerated by os-net-config
|
||||
DEVICE=storage5
|
||||
HOTPLUG=no
|
||||
ONBOOT=yes
|
||||
HOTPLUG=no
|
||||
NM_CONTROLLED=no
|
||||
PEERDNS=no
|
||||
TYPE=NFVSWITCHIntPort
|
||||
|
@ -373,8 +373,8 @@ _NFVSWITCH_CONFIG = ('SETUP_ARGS=\"-c 2,3,4,5 -u em1 -m storage5\"')
|
|||
|
||||
_OVS_IFCFG_PATCH_PORT = """# This file is autogenerated by os-net-config
|
||||
DEVICE=br-pub-patch
|
||||
HOTPLUG=no
|
||||
ONBOOT=yes
|
||||
HOTPLUG=no
|
||||
NM_CONTROLLED=no
|
||||
PEERDNS=no
|
||||
DEVICETYPE=ovs
|
||||
|
@ -385,8 +385,8 @@ OVS_PATCH_PEER=br-ex-patch
|
|||
|
||||
_LINUX_TEAM_PRIMARY_IFACE = """# This file is autogenerated by os-net-config
|
||||
DEVICE=em1
|
||||
HOTPLUG=no
|
||||
ONBOOT=yes
|
||||
HOTPLUG=no
|
||||
NM_CONTROLLED=no
|
||||
PEERDNS=no
|
||||
TEAM_MASTER=team1
|
||||
|
@ -396,8 +396,8 @@ BOOTPROTO=none
|
|||
|
||||
_CONTRAIL_VROUTER_IFACE = """# This file is autogenerated by os-net-config
|
||||
DEVICE=vhost0
|
||||
HOTPLUG=no
|
||||
ONBOOT=yes
|
||||
HOTPLUG=no
|
||||
NM_CONTROLLED=no
|
||||
PEERDNS=no
|
||||
BOOTPROTO=static
|
||||
|
@ -410,8 +410,8 @@ BIND_INT=em3
|
|||
|
||||
_CONTRAIL_VROUTER_DPDK_IFACE = """# This file is autogenerated by os-net-config
|
||||
DEVICE=vhost0
|
||||
HOTPLUG=no
|
||||
ONBOOT=yes
|
||||
HOTPLUG=no
|
||||
NM_CONTROLLED=no
|
||||
PEERDNS=no
|
||||
BOOTPROTO=static
|
||||
|
@ -427,8 +427,8 @@ CPU_LIST=0-31
|
|||
_CONTRAIL_VROUTER_DPDK_IFACE_CUST_DRIVER = """# This file is autogenerated by \
|
||||
os-net-config
|
||||
DEVICE=vhost0
|
||||
HOTPLUG=no
|
||||
ONBOOT=yes
|
||||
HOTPLUG=no
|
||||
NM_CONTROLLED=no
|
||||
PEERDNS=no
|
||||
BOOTPROTO=static
|
||||
|
@ -444,8 +444,8 @@ CPU_LIST=0-31
|
|||
_CONTRAIL_VROUTER_DPDK_BOND_IFACE = """# This file is autogenerated by \
|
||||
os-net-config
|
||||
DEVICE=vhost0
|
||||
HOTPLUG=no
|
||||
ONBOOT=yes
|
||||
HOTPLUG=no
|
||||
NM_CONTROLLED=no
|
||||
PEERDNS=no
|
||||
BOOTPROTO=static
|
||||
|
@ -948,8 +948,8 @@ class TestIfcfgNetConfig(base.TestCase):
|
|||
|
||||
em2_config = """# This file is autogenerated by os-net-config
|
||||
DEVICE=em2
|
||||
HOTPLUG=no
|
||||
ONBOOT=yes
|
||||
HOTPLUG=no
|
||||
NM_CONTROLLED=no
|
||||
PEERDNS=no
|
||||
BOOTPROTO=none
|
||||
|
@ -991,16 +991,16 @@ BOOTPROTO=none
|
|||
self.provider.add_interface(interface2)
|
||||
em1_config = """# This file is autogenerated by os-net-config
|
||||
DEVICE=em1
|
||||
HOTPLUG=no
|
||||
ONBOOT=yes
|
||||
HOTPLUG=no
|
||||
NM_CONTROLLED=no
|
||||
PEERDNS=no
|
||||
BOOTPROTO=none
|
||||
"""
|
||||
em2_config = """# This file is autogenerated by os-net-config
|
||||
DEVICE=em2
|
||||
HOTPLUG=no
|
||||
ONBOOT=yes
|
||||
HOTPLUG=no
|
||||
NM_CONTROLLED=no
|
||||
PEERDNS=no
|
||||
BOOTPROTO=none
|
||||
|
@ -1014,8 +1014,8 @@ DEFROUTE=no
|
|||
self.provider.add_interface(interface1)
|
||||
em1_config = """# This file is autogenerated by os-net-config
|
||||
DEVICE=em1
|
||||
HOTPLUG=no
|
||||
ONBOOT=yes
|
||||
HOTPLUG=no
|
||||
NM_CONTROLLED=no
|
||||
PEERDNS=no
|
||||
BOOTPROTO=none
|
||||
|
@ -1029,8 +1029,8 @@ DHCLIENTARGS=--foobar
|
|||
self.provider.add_interface(interface1)
|
||||
em1_config = """# This file is autogenerated by os-net-config
|
||||
DEVICE=em1
|
||||
HOTPLUG=no
|
||||
ONBOOT=yes
|
||||
HOTPLUG=no
|
||||
NM_CONTROLLED=no
|
||||
PEERDNS=no
|
||||
BOOTPROTO=none
|
||||
|
@ -1043,8 +1043,8 @@ ETHTOOL_OPTS=\"speed 1000 duplex full\"
|
|||
self.provider.add_interface(interface1)
|
||||
em1_config = """# This file is autogenerated by os-net-config
|
||||
DEVICE=em1
|
||||
HOTPLUG=no
|
||||
ONBOOT=yes
|
||||
HOTPLUG=no
|
||||
NM_CONTROLLED=no
|
||||
BOOTPROTO=none
|
||||
DNS1=1.2.3.4
|
||||
|
@ -1057,8 +1057,8 @@ DNS1=1.2.3.4
|
|||
self.provider.add_interface(interface1)
|
||||
em1_config = """# This file is autogenerated by os-net-config
|
||||
DEVICE=em1
|
||||
HOTPLUG=no
|
||||
ONBOOT=yes
|
||||
HOTPLUG=no
|
||||
NM_CONTROLLED=no
|
||||
BOOTPROTO=none
|
||||
DNS1=1.2.3.4
|
||||
|
@ -1073,8 +1073,8 @@ DNS2=5.6.7.8
|
|||
self.provider.add_interface(interface1)
|
||||
em1_config = """# This file is autogenerated by os-net-config
|
||||
DEVICE=em1
|
||||
HOTPLUG=no
|
||||
ONBOOT=yes
|
||||
HOTPLUG=no
|
||||
NM_CONTROLLED=no
|
||||
BOOTPROTO=none
|
||||
DNS1=1.2.3.4
|
||||
|
@ -1111,8 +1111,8 @@ DNS2=5.6.7.8
|
|||
self.provider.add_sriov_vf(vf)
|
||||
vf_config = """# This file is autogenerated by os-net-config
|
||||
DEVICE=eth2_7
|
||||
HOTPLUG=no
|
||||
ONBOOT=yes
|
||||
HOTPLUG=no
|
||||
NM_CONTROLLED=no
|
||||
PEERDNS=no
|
||||
BOOTPROTO=static
|
||||
|
@ -1135,8 +1135,8 @@ NETMASK=255.255.255.0
|
|||
self.provider.add_sriov_pf(pf)
|
||||
pf_config = """# This file is autogenerated by os-net-config
|
||||
DEVICE=eth2
|
||||
HOTPLUG=no
|
||||
ONBOOT=yes
|
||||
HOTPLUG=no
|
||||
NM_CONTROLLED=no
|
||||
PEERDNS=no
|
||||
BOOTPROTO=none
|
||||
|
@ -1163,8 +1163,8 @@ BOOTPROTO=none
|
|||
self.provider.add_ovs_user_bridge(bridge)
|
||||
br_link_config = """# This file is autogenerated by os-net-config
|
||||
DEVICE=br-link
|
||||
HOTPLUG=no
|
||||
ONBOOT=yes
|
||||
HOTPLUG=no
|
||||
NM_CONTROLLED=no
|
||||
PEERDNS=no
|
||||
DEVICETYPE=ovs
|
||||
|
@ -1172,8 +1172,8 @@ TYPE=OVSUserBridge
|
|||
"""
|
||||
dpdk0_config = """# This file is autogenerated by os-net-config
|
||||
DEVICE=dpdk0
|
||||
HOTPLUG=no
|
||||
ONBOOT=yes
|
||||
HOTPLUG=no
|
||||
NM_CONTROLLED=no
|
||||
PEERDNS=no
|
||||
DEVICETYPE=ovs
|
||||
|
@ -1206,8 +1206,8 @@ OVS_EXTRA="set Interface $DEVICE options:dpdk-devargs=0000:00:09.0"
|
|||
self.provider.add_ovs_user_bridge(bridge)
|
||||
br_link_config = """# This file is autogenerated by os-net-config
|
||||
DEVICE=br-link
|
||||
HOTPLUG=no
|
||||
ONBOOT=yes
|
||||
HOTPLUG=no
|
||||
NM_CONTROLLED=no
|
||||
PEERDNS=no
|
||||
DEVICETYPE=ovs
|
||||
|
@ -1215,8 +1215,8 @@ TYPE=OVSUserBridge
|
|||
"""
|
||||
dpdk0_config = """# This file is autogenerated by os-net-config
|
||||
DEVICE=dpdk0
|
||||
HOTPLUG=no
|
||||
ONBOOT=yes
|
||||
HOTPLUG=no
|
||||
NM_CONTROLLED=no
|
||||
PEERDNS=no
|
||||
DEVICETYPE=ovs
|
||||
|
@ -1256,8 +1256,8 @@ OVS_EXTRA="set Interface $DEVICE options:dpdk-devargs=0000:00:09.0 \
|
|||
|
||||
dpdk_bond_config = """# This file is autogenerated by os-net-config
|
||||
DEVICE=dpdkbond0
|
||||
HOTPLUG=no
|
||||
ONBOOT=yes
|
||||
HOTPLUG=no
|
||||
NM_CONTROLLED=no
|
||||
PEERDNS=no
|
||||
DEVICETYPE=ovs
|
||||
|
@ -1295,8 +1295,8 @@ OVS_EXTRA="set Interface dpdk0 options:dpdk-devargs=0000:00:08.0 \
|
|||
|
||||
dpdk_bond_config = """# This file is autogenerated by os-net-config
|
||||
DEVICE=dpdkbond0
|
||||
HOTPLUG=no
|
||||
ONBOOT=yes
|
||||
HOTPLUG=no
|
||||
NM_CONTROLLED=no
|
||||
PEERDNS=no
|
||||
DEVICETYPE=ovs
|
||||
|
@ -1337,8 +1337,8 @@ OVS_EXTRA="set Interface dpdk0 options:dpdk-devargs=0000:00:08.0 \
|
|||
|
||||
dpdk_bond_config = """# This file is autogenerated by os-net-config
|
||||
DEVICE=dpdkbond0
|
||||
HOTPLUG=no
|
||||
ONBOOT=yes
|
||||
HOTPLUG=no
|
||||
NM_CONTROLLED=no
|
||||
PEERDNS=no
|
||||
DEVICETYPE=ovs
|
||||
|
@ -1379,8 +1379,8 @@ OVS_EXTRA="set Interface dpdk0 options:dpdk-devargs=0000:00:08.0 \
|
|||
|
||||
dpdk_bond_config = """# This file is autogenerated by os-net-config
|
||||
DEVICE=dpdkbond0
|
||||
HOTPLUG=no
|
||||
ONBOOT=yes
|
||||
HOTPLUG=no
|
||||
NM_CONTROLLED=no
|
||||
PEERDNS=no
|
||||
DEVICETYPE=ovs
|
||||
|
|
Loading…
Reference in New Issue