diff options
authorDan Sneddon <dsneddon@redhat.com>2017-06-21 15:48:17 -0700
committerDan Sneddon <dsneddon@redhat.com>2017-07-18 19:54:39 +0000
commit38e67fcd310cd2a34c4213f6fc57f2f943e52f2a (patch)
parent187c1e66d4341e6c1fad308ca4d17d4d5026f61a (diff)
Fix --noop being ignored for dhclient execution
The stop_dhclient_execution() method calls netconfig.execute directly from the object, instead of from the instance of the object. This has the effect that when execute is called, noop is always set false, even if os-net-config was called with --noop. This results in a failure or network outage. This change checks the value of self.noop from within the provider.apply() method before calling the stop_dhclient_execution method. Change-Id: Ie2cc4519d7028dceb3a14bd7711839834db0ebdf Closes-bug: 1699590
1 files changed, 4 insertions, 1 deletions
diff --git a/os_net_config/impl_ifcfg.py b/os_net_config/impl_ifcfg.py
index 997b695..982a4ea 100644
--- a/os_net_config/impl_ifcfg.py
+++ b/os_net_config/impl_ifcfg.py
@@ -1019,7 +1019,10 @@ class IfcfgNetConfig(os_net_config.NetConfig):
# If dhclient is running and dhcp not set, stop dhclient
for interface in stop_dhclient_interfaces:
- stop_dhclient_process(interface)
+ logger.debug("Calling stop_dhclient_interfaces() for %s" %
+ interface)
+ if not self.noop:
+ stop_dhclient_process(interface)
for interface in restart_interfaces: