Commit 6ed64c6d authored by Seblu's avatar Seblu
Browse files

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

parent e387d138
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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:
+4 −2
Original line number Diff line number Diff line
@@ -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'''