Commit ca5fca29 authored by Seblu's avatar Seblu
Browse files

command exec use new callback args

parent 7a933c03
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -194,7 +194,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["output"])
                    _options["callback"](obj)
                if _options["status"]:
                    self.print_objects(d, ("output"))
            except RpcError as e:
+2 −3
Original line number Diff line number Diff line
@@ -26,9 +26,8 @@ class Command_exec(TqlCommand):

    def _cb_print_output(self, d):
        '''Print output of execute by object'''
        for o in d:
            self.printer.out("%s output:"%o[0])
            self.printer.out("".join(o[1][0][0:]), nl="")
        self.printer.out("%s output:"%d["id"])
        self.printer.out(d.get("output", ""), nl="")

class Command_shutdown(TqlCommand):
    '''Shutdown a physical host'''