Skip to content
Snippets Groups Projects
Commit ca5fca29 authored by Seblu's avatar Seblu
Browse files

command exec use new callback args

parent 7a933c03
No related branches found
Tags v5.7.2-2
No related merge requests found
...@@ -194,7 +194,7 @@ class TqlCommand(OptionCommand): ...@@ -194,7 +194,7 @@ class TqlCommand(OptionCommand):
l[_options["tql_index"]] = "id=%s"%obj["id"] l[_options["tql_index"]] = "id=%s"%obj["id"]
d = self.cli.rpc.call(*tuple(l), **kwargs) d = self.cli.rpc.call(*tuple(l), **kwargs)
if _options["callback"] is not None: if _options["callback"] is not None:
_options["callback"](obj["output"]) _options["callback"](obj)
if _options["status"]: if _options["status"]:
self.print_objects(d, ("output")) self.print_objects(d, ("output"))
except RpcError as e: except RpcError as e:
......
...@@ -26,9 +26,8 @@ class Command_exec(TqlCommand): ...@@ -26,9 +26,8 @@ class Command_exec(TqlCommand):
def _cb_print_output(self, d): def _cb_print_output(self, d):
'''Print output of execute by object''' '''Print output of execute by object'''
for o in d: self.printer.out("%s output:"%d["id"])
self.printer.out("%s output:"%o[0]) self.printer.out(d.get("output", ""), nl="")
self.printer.out("".join(o[1][0][0:]), nl="")
class Command_shutdown(TqlCommand): class Command_shutdown(TqlCommand):
'''Shutdown a physical host''' '''Shutdown a physical host'''
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment