summaryrefslogtreecommitdiffstats
path: root/glustolibs-gluster/glustolibs/gluster/brick_libs.py
diff options
context:
space:
mode:
authorShwethaHP <spandura@redhat.com>2017-08-19 11:02:35 +0530
committerShwethaHP <spandura@redhat.com>2017-08-19 11:08:21 +0530
commita8701fc8c8855429e9fc7da99dbe2b6b952802f2 (patch)
tree8eb636fdbc957b26ec60292e1b2273e9bf8fec67 /glustolibs-gluster/glustolibs/gluster/brick_libs.py
parent82a928a7fb408718db94df026b66e807eb554873 (diff)
Fixing the BVT Issues:
1) self-heal failures: With the recent changes made to gluster for the bug: https://bugzilla.redhat.com/show_bug.cgi?id=1480423, the location of the brick process pid's changed to /var/run/gluster. Making the corresponding changes to glusto-tests libraries. Moving away from referring to pid file to grep for the process with the brick name. This fixes the issue. 2) Group options not being set properly: Since we were popping the 'group' option from the 'options' dictionary after the group options being set to set the other volume options, the option gets removed from the g.config['gluster']['smb_volume_options'] as well. Hence perform a deep copy of the dict before modifying the dict. Change-Id: I293bf81913857cb0327f30aa1db5aaa9be5a318e Signed-off-by: ShwethaHP <spandura@redhat.com>
Diffstat (limited to 'glustolibs-gluster/glustolibs/gluster/brick_libs.py')
-rw-r--r--glustolibs-gluster/glustolibs/gluster/brick_libs.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/glustolibs-gluster/glustolibs/gluster/brick_libs.py b/glustolibs-gluster/glustolibs/gluster/brick_libs.py
index ce23c44..b4d2328 100644
--- a/glustolibs-gluster/glustolibs/gluster/brick_libs.py
+++ b/glustolibs-gluster/glustolibs/gluster/brick_libs.py
@@ -193,9 +193,10 @@ def bring_bricks_offline(volname, bricks_list,
if bring_brick_offline_method == 'service_kill':
brick_node, brick_path = brick.split(":")
brick_path = brick_path.replace("/", "-")
- kill_cmd = ("pid=`cat /var/lib/glusterd/vols/%s/run/%s%s.pid` && "
+ kill_cmd = ("pid=`ps -ef | grep -ve 'grep' | "
+ "grep -e '%s%s.pid' | awk '{print $2}'` && "
"kill -15 $pid || kill -9 $pid" %
- (volname, brick_node, brick_path))
+ (brick_node, brick_path))
ret, _, _ = g.run(brick_node, kill_cmd)
if ret != 0:
g.log.error("Unable to kill the brick %s", brick)