Add response message when the state of a server is reset

When a request is made for reset the server state it will not print any
success message if it got reset successfully. The error message is
already getting printed when the reset action fails. This fix will
print response message if the reset action is success.

Request>> nova reset-state --active <UUID>
Output Message will print as: Reset state for server <UUID> succeeded;
new state is active

    Closes-Bug: #1480428

Change-Id: Id069bc55fd88ce7e62f82f20e47be5373bb6ce8f
This commit is contained in:
Satheesh Ulaganathan 2015-07-31 15:10:49 -07:00
parent 63a32946c7
commit 67f673f2c9
1 changed files with 2 additions and 0 deletions

View File

@ -3499,6 +3499,8 @@ def do_reset_state(cs, args):
for server in args.server:
try:
_find_server(cs, server).reset_state(args.state)
msg = "Reset state for server %s succeeded; new state is %s"
print(msg % (server, args.state))
except Exception as e:
failure_flag = True
msg = "Reset state for server %s failed: %s" % (server, e)