From: Rishabh Dave Date: Tue, 17 Dec 2019 04:28:49 +0000 (+0530) Subject: cephfs-shell: cephfs-shell breaks when conf_get() returns None X-Git-Tag: v15.1.0~296^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f48d5631c93173208025d6b72c8a3e2495cc3845;p=ceph.git cephfs-shell: cephfs-shell breaks when conf_get() returns None 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 --- diff --git a/src/tools/cephfs/cephfs-shell b/src/tools/cephfs/cephfs-shell index 1459fe4fdf3..3b2f924a6cc 100755 --- a/src/tools/cephfs/cephfs-shell +++ b/src/tools/cephfs/cephfs-shell @@ -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']: