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-10 14:32:43 -0800
commit5f0145b88571b945b633f999c0d767ccefdce86b (patch)
tree8a75cb10820479d5d54a387ab499f4743b5dac65 /os_net_config/impl_ifcfg.py
parentab0e0d433fb363f6a01b7c8305771f2bde47930e (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
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 84a5139..cf3b257 100644
--- a/os_net_config/impl_ifcfg.py
+++ b/os_net_config/impl_ifcfg.py
@@ -142,7 +142,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):