Skip to content

Commit

Permalink
Fix a svcmgr stack when --format is not supported by the action
Browse files Browse the repository at this point in the history
In this case, just print so on stderr.

Example:

$ sudo svcmgr -s testmd print status --format table
unsupported format for this action
  • Loading branch information
cvaroqui committed Sep 5, 2017
1 parent 544244d commit a18b2f5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/node.py
Expand Up @@ -2637,8 +2637,11 @@ def do_svcs_action(self, action, options):
else:
if ret is None:
ret = 0
elif isinstance(ret, dict) and "error" in ret:
print(ret["error"], file=sys.stderr)
elif isinstance(ret, dict):
if "error" in ret:
print(ret["error"], file=sys.stderr)
else:
print("unsupported format for this action", file=sys.stderr)
ret = 1
err += ret
except ex.excError as exc:
Expand Down

0 comments on commit a18b2f5

Please sign in to comment.