From 5f0145b88571b945b633f999c0d767ccefdce86b Mon Sep 17 00:00:00 2001 From: Dan Sneddon Date: Fri, 10 Mar 2017 13:19:06 -0800 Subject: 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 --- os_net_config/impl_ifcfg.py | 5 ++++- 1 file changed, 4 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 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): -- cgit 1.2.3-korg