From 2fca91eb2a84b5b92f9d0eac6ef3894ed23340ff Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Mon, 17 Aug 2015 23:02:40 +0200 Subject: [PATCH] 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 --- src/ceph-disk | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ceph-disk b/src/ceph-disk index 555f62c3ee3f5..65fff4f724ea8 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( -- 2.39.5