diff --git a/cccli/command/command.py b/cccli/command/command.py index 868581b954abd4ac200162ca51ee5d59b55fc3ae..90f42ad6168c57102ef103cfce9e37542382ddf8 100644 --- a/cccli/command/command.py +++ b/cccli/command/command.py @@ -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: diff --git a/cccli/command/host.py b/cccli/command/host.py index e533fd4ab665f15c455ad4bc4a3c3e4c1400af5e..4d232b42b3a495da45596ac304448a9f7baf4f85 100644 --- a/cccli/command/host.py +++ b/cccli/command/host.py @@ -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'''