aboutsummaryrefslogtreecommitdiffstats
path: root/os_net_config/impl_ifcfg.py
diff options
context:
space:
mode:
authorDan Sneddon <dsneddon@redhat.com>2017-03-10 13:19:06 -0800
committerDan Sneddon <dsneddon@redhat.com>2017-03-13 19:08:06 +0000
commit41634740c6d83fa3be4456239d37c2cd9a7b97ae (patch)
tree1f404777c11a2560eaefa75f020f4b97b701541a /os_net_config/impl_ifcfg.py
parent3bccab387cc1c0cf60480c4f4d2f3f9a8e58e544 (diff)
Allow setting NM_CONTROLLED=yes in os-net-config ifcfg files
This change adds a flag to the base interface type, nm_controlled. If this flag is true, the ifcfg file will contain NM_CONTROLLED=yes. Since this flag is applied at the base it applies to any interface type. Note that not all interface types are supported by NetworkManager at this time, so this option should be used with caution. A demonstration of the usage is included in the linux_bond_networkmanager.yaml file in the sample directory. Change-Id: I2df6ce5b4bdb04651f27fc5daa64aa752e47f3b1 Closes-Bug: 1671888 (cherry picked from commit 5f0145b88571b945b633f999c0d767ccefdce86b)
Diffstat (limited to 'os_net_config/impl_ifcfg.py')
-rw-r--r--os_net_config/impl_ifcfg.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/os_net_config/impl_ifcfg.py b/os_net_config/impl_ifcfg.py
index 825a186..ccbb647 100644
--- a/os_net_config/impl_ifcfg.py
+++ b/os_net_config/impl_ifcfg.py
@@ -135,7 +135,10 @@ class IfcfgNetConfig(os_net_config.NetConfig):
data += "HOTPLUG=yes\n"
else:
data += "HOTPLUG=no\n"
- data += "NM_CONTROLLED=no\n"
+ if base_opt.nm_controlled:
+ data += "NM_CONTROLLED=yes\n"
+ else:
+ data += "NM_CONTROLLED=no\n"
if not base_opt.dns_servers and not base_opt.use_dhcp:
data += "PEERDNS=no\n"
if isinstance(base_opt, objects.Vlan):