From 173068d52449eb04e905b29da6e417ae69cd8055 Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Mon, 7 Mar 2016 12:34:47 +0000 Subject: [PATCH] nova-manage: Print, not raise, exceptions Raising an exception means it is not possible to return a status code. Seeing as the 'nova-manage' application is an interactive one, it's viable to fix this by printing the exception rather than raising. Change-Id: Ifa3f80e4f7dccada439ffc9363e9f1504c8c2da1 Closes-bug: #1538227 --- nova/cmd/manage.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nova/cmd/manage.py b/nova/cmd/manage.py index 1b388713600b..033caa38f691 100644 --- a/nova/cmd/manage.py +++ b/nova/cmd/manage.py @@ -1497,6 +1497,6 @@ def main(): ret = fn(*fn_args, **fn_kwargs) rpc.cleanup() return(ret) - except Exception: - print(_("Command failed, please check log for more info")) - raise + except Exception as ex: + print(_("error: %s") % ex) + return(1)