Zhou Zheng Sheng has uploaded a new change for review.
Change subject: vdsm.tool.service: fix _systemctlNative
......................................................................
vdsm.tool.service: fix _systemctlNative
_systemctlNative lists systemd units and check if the given service is
managed by systemd. There is a bug in the checking code. When
splitting words, it does not fetch the word from the resulting array.
The first word is the name of the unit/service. This patch fix the
problem.
Another small problem is it does not format the error message correctly,
this patch fix the formatting.
At last it fixes a bad doc string.
Change-Id: I3a3b903786d431ba306bb2cf3f7f35d6de38ed42
Signed-off-by: Zhou Zheng Sheng <zhshzhou(a)linux.vnet.ibm.com>
---
M lib/vdsm/tool/service.py
1 file changed, 3 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/05/15305/1
diff --git a/lib/vdsm/tool/service.py b/lib/vdsm/tool/service.py
index 8bcfefa..8b4e5c5 100644
--- a/lib/vdsm/tool/service.py
+++ b/lib/vdsm/tool/service.py
@@ -81,9 +81,9 @@
if rc != 0:
return (rc, out, err)
for line in out:
- if srvName + ".service" == line.split(" ", 1):
+ if srvName + ".service" == line.split(" ", 1)[0]:
return systemctlFun(srvName)
- return (1, "", "%s is not native systemctl service")
+ return (1, "", "%s is not native systemctl service" %
srvName)
return wrapper
@_systemctlNative
@@ -276,7 +276,7 @@
@expose("service-restart")
def service_restart(srvName):
"""
- Get status of a system service
+ Restart a system service
"""
return _runAlts(_srvRestartAlts, srvName)
--
To view, visit
http://gerrit.ovirt.org/15305
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3a3b903786d431ba306bb2cf3f7f35d6de38ed42
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Zhou Zheng Sheng <zhshzhou(a)linux.vnet.ibm.com>