Change in vdsm[ovirt-3.5]: only on el7

ibarkan at redhat.com ibarkan at redhat.com
Tue Jul 21 11:35:13 UTC 2015


Ido Barkan has uploaded a new change for review.

Change subject: only on el7
......................................................................

only on el7

Change-Id: Iafda98603ae95694036d231dbc654e1208b1c68e
Signed-off-by: Ido Barkan <ibarkan at redhat.com>
---
M lib/vdsm/cmdutils.py
M vdsm/network/configurators/dhclient.py
M vdsm/network/configurators/ifcfg.py
3 files changed, 11 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/54/43854/1

diff --git a/lib/vdsm/cmdutils.py b/lib/vdsm/cmdutils.py
index 5d1c96e..b3abd1f 100644
--- a/lib/vdsm/cmdutils.py
+++ b/lib/vdsm/cmdutils.py
@@ -21,6 +21,8 @@
 
 
 def systemd_run(cmd, scope=False, unit=None, slice=None):
+    # warning: this is supported only on OS versions that use systemd (el7 and
+    # later).
     command = [constants.EXT_SYSTEMD_RUN]
     if scope:
         command.append('--scope')
diff --git a/vdsm/network/configurators/dhclient.py b/vdsm/network/configurators/dhclient.py
index b2af4a0..bb1a3fd 100644
--- a/vdsm/network/configurators/dhclient.py
+++ b/vdsm/network/configurators/dhclient.py
@@ -31,6 +31,9 @@
 from vdsm.utils import pgrep
 from vdsm.utils import rmFile
 
+import dsaversion
+
+EL6 = dsaversion.is_el6()
 DHCLIENT_CGROUP = 'vdsm-dhclient'
 
 
@@ -54,7 +57,9 @@
             kill_dhclient(self.iface)
         cmd = [self.DHCLIENT.cmd, '-1', '-pf', self.pidFile, '-lf',
                self.leaseFile, self.iface]
-        cmd = cmdutils.systemd_run(cmd, scope=True, slice=self._cgroup)
+        if not EL6:
+            cmd = cmdutils.systemd_run(cmd, scope=True, slice=self._cgroup)
+
         rc, out, err = execCmd(cmd)
         return rc, out, err
 
diff --git a/vdsm/network/configurators/ifcfg.py b/vdsm/network/configurators/ifcfg.py
index b988925..3d35f92 100644
--- a/vdsm/network/configurators/ifcfg.py
+++ b/vdsm/network/configurators/ifcfg.py
@@ -48,6 +48,8 @@
 from ..sourceroute import StaticSourceRoute, DynamicSourceRoute
 import dsaversion  # TODO: Make parent package import when vdsm is a package
 
+EL6 = dsaversion.is_el6()
+
 
 def _hwaddr_required():
     return config.get('vars', 'hwaddr_in_ifcfg') == 'always'
@@ -790,7 +792,7 @@
     def _ifup(netIf):
         cmd = [constants.EXT_IFUP, netIf]
         
-        if cgroup is not None:
+        if not EL6 and cgroup is not None:
             cmd = cmdutils.systemd_run(cmd, scope=True, slice=cgroup)
             
         rc, out, err = utils.execCmd(cmd, raw=False)


-- 
To view, visit https://gerrit.ovirt.org/43854
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iafda98603ae95694036d231dbc654e1208b1c68e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Ido Barkan <ibarkan at redhat.com>


More information about the vdsm-patches mailing list