From: Rishabh Dave Date: Thu, 19 Dec 2019 13:01:27 +0000 (+0530) Subject: cephfs-shell: set shell.exit_code to 1 when reading conf fails X-Git-Tag: v15.1.0~296^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4769ccabfec414e82a041ea94c4e663937b91261;p=ceph.git cephfs-shell: set shell.exit_code to 1 when reading conf fails And initialize shell.exit_code to 0. Signed-off-by: Rishabh Dave --- diff --git a/src/tools/cephfs/cephfs-shell b/src/tools/cephfs/cephfs-shell index 3b2f924a6cc..a5281ce6041 100755 --- a/src/tools/cephfs/cephfs-shell +++ b/src/tools/cephfs/cephfs-shell @@ -1452,6 +1452,7 @@ def read_ceph_conf(shell, config_file): shell.timing = get_bool_vals_for_boolopts(cephfs.conf_get('timing')) except (OSError, libcephfs.Error) as e: perror(e) + shell.exit_code = 1 if __name__ == '__main__': config_file = '' @@ -1485,5 +1486,9 @@ if __name__ == '__main__': setup_cephfs(config_file) shell = CephFSShell() + shell.exit_code = 0 read_ceph_conf(shell, config_file) - sys.exit(shell.cmdloop()) + + shell.exit_code = shell.cmdloop() + + sys.exit(shell.exit_code)