]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephfs-shell: set shell.exit_code to 1 when reading conf fails 32347/head
authorRishabh Dave <ridave@redhat.com>
Thu, 19 Dec 2019 13:01:27 +0000 (18:31 +0530)
committerRishabh Dave <ridave@redhat.com>
Mon, 30 Dec 2019 05:06:02 +0000 (10:36 +0530)
And initialize shell.exit_code to 0.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
src/tools/cephfs/cephfs-shell

index 3b2f924a6cc99f02b7a12053c6a94a5ca2a41325..a5281ce6041d383ce3a58cdfb3bbd651bc98b3c7 100755 (executable)
@@ -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)