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 <ldachary@redhat.com>
This commit is contained in:
Loic Dachary 2015-08-17 23:02:40 +02:00
parent aac8971988
commit 2fca91eb2a

View File

@ -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(