From 2188cf1651648af1900b7bb070f9b1eb3f982c3b Mon Sep 17 00:00:00 2001 From: Giulio Fidente Date: Wed, 6 Apr 2016 18:30:36 +0200 Subject: Use PEERDNS when no dns_servers or use_dhcp is provided PEERDNS=no ensures resolv.conf is not modified by ifup/ifdown when restarting an interface. Closes-bug: #1567004 Change-Id: Idec15d4c1630638ce8362f9d95ae3c09bcae86a3 --- os_net_config/impl_ifcfg.py | 2 ++ 1 file changed, 2 insertions(+) (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 2172a08..f2a5dc0 100644 --- a/os_net_config/impl_ifcfg.py +++ b/os_net_config/impl_ifcfg.py @@ -88,6 +88,8 @@ class IfcfgNetConfig(os_net_config.NetConfig): data += "ONBOOT=yes\n" data += "HOTPLUG=no\n" 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): if not base_opt.ovs_port: # vlans on OVS bridges are internal ports (no device, etc) -- cgit 1.2.3-korg