aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Prince <dprince@redhat.com>2015-03-19 11:25:18 -0400
committerDan Prince <dprince@redhat.com>2015-03-19 11:25:18 -0400
commit54ae015bba1584c4150fe4dc4ba16b74a3b349b1 (patch)
tree13a02b7764bf60de46f589d6ba465b2c0a1b7f4b
parent3f36600d1c7159f3ba00a2449e381cd32239af4e (diff)
Mark ENI files as autogenerated
End users may not realize these files are autogenerated and may be surprised if they make changes to the /etc/sysconfig/network-scripts files which are then overwritten on reboot. Change-Id: I526c228463bd10de2cf3724aa4159b63a9aeff80
-rw-r--r--os_net_config/impl_ifcfg.py3
-rw-r--r--os_net_config/tests/test_impl_ifcfg.py15
2 files changed, 12 insertions, 6 deletions
diff --git a/os_net_config/impl_ifcfg.py b/os_net_config/impl_ifcfg.py
index 47f32a6..86cacf5 100644
--- a/os_net_config/impl_ifcfg.py
+++ b/os_net_config/impl_ifcfg.py
@@ -68,7 +68,8 @@ class IfcfgNetConfig(os_net_config.NetConfig):
ovs_extra = []
- data = "DEVICE=%s\n" % base_opt.name
+ data = "# This file is autogenerated by os-net-config\n"
+ data += "DEVICE=%s\n" % base_opt.name
data += "ONBOOT=yes\n"
data += "HOTPLUG=no\n"
if isinstance(base_opt, objects.Vlan):
diff --git a/os_net_config/tests/test_impl_ifcfg.py b/os_net_config/tests/test_impl_ifcfg.py
index 3930709..34a9e40 100644
--- a/os_net_config/tests/test_impl_ifcfg.py
+++ b/os_net_config/tests/test_impl_ifcfg.py
@@ -25,7 +25,8 @@ from os_net_config.tests import base
from os_net_config import utils
-_BASE_IFCFG = """DEVICE=em1
+_BASE_IFCFG = """# This file is autogenerated by os-net-config
+DEVICE=em1
ONBOOT=yes
HOTPLUG=no
"""
@@ -60,7 +61,8 @@ OVS_BRIDGE=br-ctlplane
BOOTPROTO=none
"""
-_OVS_BRIDGE_DHCP = """DEVICE=br-ctlplane
+_OVS_BRIDGE_DHCP = """# This file is autogenerated by os-net-config
+DEVICE=br-ctlplane
ONBOOT=yes
HOTPLUG=no
DEVICETYPE=ovs
@@ -78,7 +80,8 @@ _OVS_BRIDGE_DHCP_OVS_EXTRA = _OVS_BRIDGE_DHCP + \
" -- br-set-external-id br-ctlplane bridge-id br-ctlplane\"\n"
-_BASE_VLAN = """DEVICE=vlan5
+_BASE_VLAN = """# This file is autogenerated by os-net-config
+DEVICE=vlan5
ONBOOT=yes
HOTPLUG=no
VLAN=yes
@@ -100,7 +103,8 @@ BOOTPROTO=none
"""
-_OVS_BOND_DHCP = """DEVICE=bond0
+_OVS_BOND_DHCP = """# This file is autogenerated by os-net-config
+DEVICE=bond0
ONBOOT=yes
HOTPLUG=no
DEVICETYPE=ovs
@@ -246,7 +250,8 @@ class TestIfcfgNetConfig(base.TestCase):
self.provider.add_bond(bond)
self.assertEqual(_NO_IP, self.get_interface_config('em1'))
- em2_config = """DEVICE=em2
+ em2_config = """# This file is autogenerated by os-net-config
+DEVICE=em2
ONBOOT=yes
HOTPLUG=no
BOOTPROTO=none