summaryrefslogtreecommitdiffstats
path: root/glustolibs-gluster/glustolibs/gluster
diff options
context:
space:
mode:
Diffstat (limited to 'glustolibs-gluster/glustolibs/gluster')
-rw-r--r--glustolibs-gluster/glustolibs/gluster/brick_libs.py5
-rw-r--r--glustolibs-gluster/glustolibs/gluster/volume_ops.py12
2 files changed, 10 insertions, 7 deletions
diff --git a/glustolibs-gluster/glustolibs/gluster/brick_libs.py b/glustolibs-gluster/glustolibs/gluster/brick_libs.py
index ce23c442e..b4d232859 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)
diff --git a/glustolibs-gluster/glustolibs/gluster/volume_ops.py b/glustolibs-gluster/glustolibs/gluster/volume_ops.py
index 503f2c2f1..cc400390b 100644
--- a/glustolibs-gluster/glustolibs/gluster/volume_ops.py
+++ b/glustolibs-gluster/glustolibs/gluster/volume_ops.py
@@ -17,6 +17,7 @@
import re
+import copy
from glusto.core import Glusto as g
from pprint import pformat
try:
@@ -540,9 +541,10 @@ def set_volume_options(mnode, volname, options):
"""
_rc = True
+ volume_options = copy.deepcopy(options)
# Check if group options are specified.
- if 'group' in options:
- group_options = options.pop('group')
+ if 'group' in volume_options:
+ group_options = volume_options.pop('group')
if isinstance(group_options, str):
group_options = [group_options]
for group_option in group_options:
@@ -553,13 +555,13 @@ def set_volume_options(mnode, volname, options):
g.log.error("Unable to set group option: %s", group_option)
_rc = False
- for option in options:
+ for option in volume_options:
cmd = ("gluster volume set %s %s %s --mode=script"
- % (volname, option, options[option]))
+ % (volname, option, volume_options[option]))
ret, _, _ = g.run(mnode, cmd)
if ret != 0:
g.log.error("Unable to set value %s for option %s"
- % (options[option], option))
+ % (volume_options[option], option))
_rc = False
return _rc