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

fix bug in TqlCommand callback call. Fix exec command doesn't works.

parent e387d138
No related branches found
No related tags found
No related merge requests found
......@@ -208,7 +208,7 @@ class TqlCommand(OptionCommand):
l[_options["tql_index"]] = "id=%s"%obj["id"]
d = self.cli.rpc.call(*tuple(l), **kwargs)
if _options["callback"] is not None:
_options["callback"](obj)
_options["callback"](d)
if _options["status"]:
self.print_objects(d, ["output"], index=False)
except RpcError as e:
......
......@@ -26,8 +26,10 @@ class Command_exec(TqlCommand):
def _cb_print_output(self, d):
'''Print output of execute by object'''
self.printer.out("%s output:"%d["id"])
self.printer.out(d.get("output", ""), nl="")
for o in d["objects"]:
self.printer.out("%sid:%s%s%s output:"%(self.tdtc("id"), self.tdc("id"),
o["id"], color["reset"]))
self.printer.out(o.get("output", ""), nl="")
class Command_shutdown(TqlCommand):
'''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