Zhou Zheng Sheng has uploaded a new change for review. Change subject: multipath.py: use vdsm.tool.service to restart multipathd ......................................................................
multipath.py: use vdsm.tool.service to restart multipathd multipath.py restart and reload multipathd using service command directly. This patch uses vdsm-tool service module to manage the system service improves portability. It covers SysV, SystemD and Upstart as well as possible daemon names in various systems (multipathd is named multipath-tools in Ubuntu). Change-Id: I1130a4baf770b805aaea8de97556d18a2da86207 Signed-off-by: Zhou Zheng Sheng <[email protected]> --- M lib/vdsm/constants.py.in M vdsm/storage/multipath.py 2 files changed, 4 insertions(+), 2 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/28/14728/1 diff --git a/lib/vdsm/constants.py.in b/lib/vdsm/constants.py.in index 022affd..5091e48 100644 --- a/lib/vdsm/constants.py.in +++ b/lib/vdsm/constants.py.in @@ -136,3 +136,5 @@ EXT_VDSM_STORE_NET_CONFIG = '@VDSMDIR@/vdsm-store-net-config' EXT_WGET = '@WGET_PATH@' + +EXT_VDSM_TOOL = os.path.join('@prefix@', 'bin', 'vdsm-tool') diff --git a/vdsm/storage/multipath.py b/vdsm/storage/multipath.py index fb6c42d..df057be 100644 --- a/vdsm/storage/multipath.py +++ b/vdsm/storage/multipath.py @@ -175,11 +175,11 @@ # Flush all unused multipath device maps misc.execCmd([constants.EXT_MULTIPATH, "-F"], sudo=True) - cmd = [constants.EXT_SERVICE, "multipathd", "restart"] + cmd = [constants.EXT_VDSM_TOOL, "service-restart", "multipathd"] rc = misc.execCmd(cmd, sudo=True)[0] if rc != 0: # No dice - try to reload instead of restart - cmd = [constants.EXT_SERVICE, "multipathd", "reload"] + cmd = [constants.EXT_VDSM_TOOL, "service-reload", "multipathd"] rc = misc.execCmd(cmd, sudo=True)[0] if rc != 0: raise se.MultipathRestartError() -- To view, visit http://gerrit.ovirt.org/14728 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1130a4baf770b805aaea8de97556d18a2da86207 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Zhou Zheng Sheng <[email protected]> _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
