util: restructure tracevol.py function to get_subvol_group()

get_subvol_group() returns empty string if subvolumeGroup is not defined,
changed it to return "csi" as default subvolumeGroup.

Signed-off-by: Mudit Agarwal <muagarwa@redhat.com>
This commit is contained in:
Mudit Agarwal 2020-07-29 18:19:27 +05:30 committed by mergify[bot]
parent 5fa1be586a
commit 1eff20590d

View File

@ -413,9 +413,6 @@ def check_subvol_in_cluster(arg, subvol_name, fsname):
"""
# check if user has specified subvolumeGroup
subvol_group = get_subvol_group(arg)
if subvol_group == "":
# default subvolumeGroup
subvol_group = "csi"
return check_subvol_path(arg, subvol_name, subvol_group, fsname)
def check_subvol_path(arg, subvol_name, subvol_group, fsname):
@ -466,7 +463,8 @@ def get_subvol_group(arg):
except ValueError as err:
print(err, stdout)
sys.exit()
subvol_group = ""
# default subvolumeGroup
subvol_group = "csi"
cm_data = config_map['data'].get('config.json')
# Absence of 'config.json' means that the configmap
# is created by Rook and there won't be any provision to