From: Loic Dachary Date: Mon, 17 Aug 2015 21:02:40 +0000 (+0200) Subject: ceph-disk: --verbose shows a stack trace on error X-Git-Tag: v9.1.0~252^2~1^2~15 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2fca91eb2a84b5b92f9d0eac6ef3894ed23340ff;p=ceph.git ceph-disk: --verbose shows a stack trace on error 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 --- diff --git a/src/ceph-disk b/src/ceph-disk index 555f62c3ee3..65fff4f724e 100755 --- a/src/ceph-disk +++ b/src/ceph-disk @@ -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(