]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-disk: --verbose shows a stack trace on error
authorLoic Dachary <ldachary@redhat.com>
Mon, 17 Aug 2015 21:02:40 +0000 (23:02 +0200)
committerLoic Dachary <ldachary@redhat.com>
Sat, 29 Aug 2015 00:37:51 +0000 (02:37 +0200)
When running with --verbose, do not hide the stack trace from the user
when an exception is raised. It is most helpful to figure out when the
exception actually happened.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
src/ceph-disk

index 555f62c3ee3f57b368bd749eec476b8dd29efbae..65fff4f724ea87ce929a11902e0c6422f2f10f5f 100755 (executable)
@@ -3175,8 +3175,15 @@ def main():
     setup_statedir(args.statedir)
     setup_sysconfdir(args.sysconfdir)
 
-    try:
+    if args.verbose:
         args.func(args)
+    else:
+        main_catch(args.func, args)
+
+def main_catch(func, args):
+
+    try:
+        func(args)
 
     except Error as e:
         raise SystemExit(