summaryrefslogtreecommitdiffstats
path: root/glustolibs-misc/glustolibs
diff options
context:
space:
mode:
authorkshithijiyer <kshithij.ki@gmail.com>2020-04-07 00:47:17 +0530
committerkshithijiyer <kshithij.ki@gmail.com>2020-04-07 01:07:45 +0530
commite5a011ce5d20773705b949289a0fba6b45300a79 (patch)
tree61c3906199ac070b6e5ebf6794b462b800623b67 /glustolibs-misc/glustolibs
parentdd2382c613db6f3dd72a25c74d5f765006aea31f (diff)
[Libfix] Change daemon_reload() to support newer platforms
Problem: Currently the code supports both service and systemctl commands but it fails on the latest platforms with the below error on the latest platforms: ``` service glusterd reload Redirecting to /bin/systemctl reload glusterd.service Failed to reload glusterd.service: Job type reload is not applicable for unit glusterd.service. ``` This is because the latest platforms uses systemctl instead of service to reload the daemon processes: ``` systemctl daemon-reload ``` Solution: The present code doesn't work properly as the check is specific to only one platform, hence it fails. The solution for this is to just check for older platforms and run service command. For all other platforms run systemctl command. Change-Id: I19b24652b96c4794553d3659eaf0301395929bca Signed-off-by: kshithijiyer <kshithij.ki@gmail.com>
Diffstat (limited to 'glustolibs-misc/glustolibs')
-rwxr-xr-xglustolibs-misc/glustolibs/misc/misc_libs.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/glustolibs-misc/glustolibs/misc/misc_libs.py b/glustolibs-misc/glustolibs/misc/misc_libs.py
index 3ec4452d4..fea86d125 100755
--- a/glustolibs-misc/glustolibs/misc/misc_libs.py
+++ b/glustolibs-misc/glustolibs/misc/misc_libs.py
@@ -21,7 +21,7 @@ import sys
import time
from glusto.core import Glusto as g
-from glustolibs.gluster.lib_utils import is_rhel7
+from glustolibs.gluster.lib_utils import is_rhel6
def create_dirs(list_of_nodes, list_of_dir_paths):
@@ -572,14 +572,14 @@ def daemon_reload(node):
bool: True, On successful daemon reload
False, Otherwise
"""
- if is_rhel7([node]):
- cmd = "systemctl daemon-reload"
+ if is_rhel6([node]):
+ cmd = 'service glusterd reload'
ret, _, _ = g.run(node, cmd)
if ret != 0:
g.log.error("Failed to reload the daemon")
return False
else:
- cmd = 'service glusterd reload'
+ cmd = "systemctl daemon-reload"
ret, _, _ = g.run(node, cmd)
if ret != 0:
g.log.error("Failed to reload the daemon")