diff options
author | ShwethaHP <spandura@redhat.com> | 2017-08-19 11:02:35 +0530 |
---|---|---|
committer | ShwethaHP <spandura@redhat.com> | 2017-08-19 11:08:21 +0530 |
commit | a8701fc8c8855429e9fc7da99dbe2b6b952802f2 (patch) | |
tree | 8eb636fdbc957b26ec60292e1b2273e9bf8fec67 /glustolibs-gluster/glustolibs/gluster/volume_ops.py | |
parent | 82a928a7fb408718db94df026b66e807eb554873 (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/volume_ops.py')
-rw-r--r-- | glustolibs-gluster/glustolibs/gluster/volume_ops.py | 12 |
1 files changed, 7 insertions, 5 deletions
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 |