Change in vdsm[master]: vdsm-tool: add service management utilities
zhshzhou at linux.vnet.ibm.com
zhshzhou at linux.vnet.ibm.com
Mon Apr 15 09:42:32 UTC 2013
Zhou Zheng Sheng has posted comments on this change.
Change subject: vdsm-tool: add service management utilities
......................................................................
Patch Set 3: (2 inline comments)
....................................................
File lib/vdsm/tool/service.py
Line 29: from vdsm.tool import expose
Line 30: from vdsm.utils import CommandPath
Line 31:
Line 32:
Line 33: def execCmd(argv):
Thanks Yaniv, Dan, due to the PYTHONPATH reason, modules of vdsm-tool can not run exeCmd from vdsm.utils. I submit a patch to import exeCmd correctly for these modules and unify existing ad-hoc execCmd implementations ( http://gerrit.ovirt.org/#/c/13917/ ). Then I rebase my general service mgmt patch on the unifying execCmd patch.
Line 34: p = subprocess.Popen(argv, stdout=subprocess.PIPE,
Line 35: stderr=subprocess.PIPE)
Line 36: out, err = p.communicate()
Line 37: rc = p.returncode
Line 131: alreayRunRegex = r"\Wis already running\W"
Line 132: rc, out, err = execCmd(cmd)
Line 133: if rc != 0:
Line 134: # initctl returns an error if the job is already started
Line 135: # here we igore it and returns 0 if the job is already running
Done
Line 136: rc = int(re.search(alreayRunRegex, out, re.MULTILINE) is not None)
Line 137: return (rc, out, err)
Line 138:
Line 139: def _initctlStop(srvName):
--
To view, visit http://gerrit.ovirt.org/13701
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Idd1cbcf5fd00bb1ec73c5970be012e294b3b4c55
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Zhou Zheng Sheng <zhshzhou at linux.vnet.ibm.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Douglas Schilling Landgraf <dougsland at redhat.com>
Gerrit-Reviewer: Ewoud Kohl van Wijngaarden <ewoud at kohlvanwijngaarden.nl>
Gerrit-Reviewer: Federico Simoncelli <fsimonce at redhat.com>
Gerrit-Reviewer: Vered Volansky <vvolansk at redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: Yeela Kaplan <ykaplan at redhat.com>
Gerrit-Reviewer: Zhou Zheng Sheng <zhshzhou at linux.vnet.ibm.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
More information about the vdsm-patches
mailing list