From Dan Kenigsberg <danken(a)redhat.com>:
Dan Kenigsberg has uploaded a new change for review.
Change subject: net: move IFDOWN into ifcfg
......................................................................
net: move IFDOWN into ifcfg
Nobody outside the ifcfg configurator needs IFDOWN. It resolves to
/sbin/ifdown on all platforms. This patch localizes the constant into
the network subsystem.
Change-Id: I9c7a40c0763da4e919f4b9187973c9cb0d5f0c54
Signed-off-by: Dan Kenigsberg <danken(a)redhat.com>
---
M configure.ac
M lib/vdsm/constants.py.in
M lib/vdsm/network/configurators/ifcfg.py
M tests/functional/networkTests.py
4 files changed, 5 insertions(+), 4 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/51/79251/1
diff --git a/configure.ac b/configure.ac
index 80a20d2..23f466c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -336,7 +336,6 @@
AC_PATH_PROG([FUSER_PATH], [fuser], [/sbin/fuser])
AC_PATH_PROG([GREP_PATH], [grep], [/bin/grep])
AC_PATH_PROG([HWCLOCK_PATH], [hwclock], [/usr/sbin/hwclock])
-AC_PATH_PROG([IFDOWN_PATH], [ifdown], [/sbin/ifdown])
AC_PATH_PROG([IFUP_PATH], [ifup], [/sbin/ifup])
AC_PATH_PROG([IONICE_PATH], [ionice], [/usr/bin/ionice])
AC_PATH_PROG([IP_PATH], [ip], [/sbin/ip])
diff --git a/lib/vdsm/constants.py.in b/lib/vdsm/constants.py.in
index 127f553..46d2b43 100644
--- a/lib/vdsm/constants.py.in
+++ b/lib/vdsm/constants.py.in
@@ -108,7 +108,6 @@
EXT_GREP = '@GREP_PATH@'
-EXT_IFDOWN = '@IFDOWN_PATH@'
EXT_IFUP = '@IFUP_PATH@'
EXT_IONICE = '@IONICE_PATH@'
EXT_ISCSIADM = '@ISCSIADM_PATH@'
diff --git a/lib/vdsm/network/configurators/ifcfg.py
b/lib/vdsm/network/configurators/ifcfg.py
index a53029e..3acd091 100644
--- a/lib/vdsm/network/configurators/ifcfg.py
+++ b/lib/vdsm/network/configurators/ifcfg.py
@@ -68,6 +68,8 @@
CONFFILE_HEADER_SIGNATURE = '# Generated by VDSM version'
+EXT_IFDOWN = '/sbin/ifdown'
+
def is_available():
return True
@@ -844,7 +846,7 @@
def ifdown(iface):
"Bring down an interface"
- rc, _, _ = cmd.exec_sync([constants.EXT_IFDOWN, iface])
+ rc, _, _ = cmd.exec_sync([EXT_IFDOWN, iface])
return rc
diff --git a/tests/functional/networkTests.py b/tests/functional/networkTests.py
index e0ea749..ae7c79e 100644
--- a/tests/functional/networkTests.py
+++ b/tests/functional/networkTests.py
@@ -29,7 +29,8 @@
import six
import vdsm.config
-from vdsm.constants import EXT_BRCTL, EXT_IFUP, EXT_IFDOWN
+from vdsm.constants import EXT_BRCTL, EXT_IFUP
+from vdsm.network.configurators.ifcfg import EXT_IFDOWN
from vdsm.network import ipwrapper
from vdsm.network import netswitch
from vdsm.network.ip import dhclient
--
To view, visit
https://gerrit.ovirt.org/79251
To unsubscribe, visit
https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9c7a40c0763da4e919f4b9187973c9cb0d5f0c54
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <danken(a)redhat.com>