From 1eff20590de5d97f08fd9813a3ddcd4418d5ed61 Mon Sep 17 00:00:00 2001 From: Mudit Agarwal Date: Wed, 29 Jul 2020 18:19:27 +0530 Subject: [PATCH] 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 --- troubleshooting/tools/tracevol.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/troubleshooting/tools/tracevol.py b/troubleshooting/tools/tracevol.py index ba73e2093..b4fd524e8 100755 --- a/troubleshooting/tools/tracevol.py +++ b/troubleshooting/tools/tracevol.py @@ -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