diff options
authorsrijan-sivakumar <>2020-12-04 11:51:58 +0530
committerArthy Loganathan <>2020-12-18 11:56:07 +0000
commit1e835f6c6b53cd01b6e64741407b064193b2458d (patch)
parente18eccbdf53279926314ffbe8b9fca57ebb7445e (diff)
[LibFix] Optimizing setup_volume api.
Currently the setup volume API is calling the get_volume_info to obtain the volume information to check if the said volume already exists. Internally the get_volume_info would have to parse the complete xml dump received for volume info. Instead of that one can invoke the get_volume_list which would mean reduced effort put into parsing the output received as volume name is the only important factor in this check inside setup_volume. Change-Id: I024d42fe471bf26ac85dd3108d6f123cd56a0766 Signed-off-by: srijan-sivakumar <>
1 files changed, 2 insertions, 2 deletions
diff --git a/glustolibs-gluster/glustolibs/gluster/ b/glustolibs-gluster/glustolibs/gluster/
index 376ac5089..87e70ca8c 100644
--- a/glustolibs-gluster/glustolibs/gluster/
+++ b/glustolibs-gluster/glustolibs/gluster/
@@ -124,8 +124,8 @@ def setup_volume(mnode, all_servers_info, volume_config, multi_vol=False,
return False
# Check if the volume already exists
- volinfo = get_volume_info(mnode=mnode)
- if volinfo is not None and volname in volinfo.keys():
+ vollist = get_volume_list(mnode=mnode)
+ if vollist is not None and volname in vollist:"volume %s already exists. Returning...", volname)
return True