From e78b09635c424b62b22ee7f19e36abfc71348b21 Mon Sep 17 00:00:00 2001 From: Zenghui Shi Date: Mon, 26 Feb 2018 19:45:22 +0800 Subject: [PATCH] ifcfg: don't restart ovs if --no-activate is specified When --no-activate is specified, there is a chance that openvswitch service will still be restarted if dpdk port configuration file is changed. This adds a condition to check activate and restart openvswitch only if activate is true. Change-Id: Ia5a6d04eb26cc3a6e10caacb8256d6e2d183239e Closes-Bug: #1751955 Resolves: rhbz#1572668 (cherry picked from commit a330929f7708b50944e0a3bdb64b3d22c8815db0) --- os_net_config/impl_ifcfg.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/os_net_config/impl_ifcfg.py b/os_net_config/impl_ifcfg.py index 93440df6..4a0af863 100644 --- a/os_net_config/impl_ifcfg.py +++ b/os_net_config/impl_ifcfg.py @@ -1100,15 +1100,15 @@ class IfcfgNetConfig(os_net_config.NetConfig): for oldname, newname in self.renamed_interfaces.items(): self.ifrename(oldname, newname) - # DPDK initialization is done before running os-net-config, to make - # the DPDK ports available when enabled. DPDK Hotplug support is - # supported only in OvS 2.7 version. Until then, OvS needs to be - # restarted after adding a DPDK port. This change will be removed on - # migration to OvS 2.7 where DPDK Hotplug support is available. - if ovs_needs_restart: - msg = "Restart openvswitch" - self.execute(msg, '/usr/bin/systemctl', - 'restart', 'openvswitch') + # DPDK initialization is done before running os-net-config, to make + # the DPDK ports available when enabled. DPDK Hotplug support is + # supported only in OvS 2.7 version. Until then, OvS needs to be + # restarted after adding a DPDK port. This change will be removed + # on migration to OvS 2.7 where DPDK Hotplug support is available. + if ovs_needs_restart: + msg = "Restart openvswitch" + self.execute(msg, '/usr/bin/systemctl', + 'restart', 'openvswitch') for location, data in update_files.items(): self.write_config(location, data)