]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cephfs-shell: cephfs-shell breaks when conf_get() returns None
authorRishabh Dave <ridave@redhat.com>
Tue, 17 Dec 2019 04:28:49 +0000 (09:58 +0530)
committerRishabh Dave <ridave@redhat.com>
Mon, 30 Dec 2019 05:06:02 +0000 (10:36 +0530)
Equip get_bool_vals_for_boolopts() to deal when the argument's value is
None.

Fixes: https://tracker.ceph.com/issues/43329
Signed-off-by: Rishabh Dave <ridave@redhat.com>
src/tools/cephfs/cephfs-shell

index 1459fe4fdf3fb3838fc483a07a44d7cf84dda951..3b2f924a6cc99f02b7a12053c6a94a5ca2a41325 100755 (executable)
@@ -1421,6 +1421,10 @@ def setup_cephfs(config_file):
         sys.exit(1)
 
 def get_bool_vals_for_boolopts(val):
+    if not isinstance(val, str):
+        return val
+
+    val = val.replace('\n', '')
     if val.lower() in ['true', 'yes']:
         return True
     elif val.lower() in ['false', 'no']: