From ca5fca2953f6e59d30ac2ba578a1b7dd2caff4c3 Mon Sep 17 00:00:00 2001
From: Seblu <sebastien.luttringer@smartjog.com>
Date: Fri, 18 Feb 2011 20:12:18 +0100
Subject: [PATCH] command exec use new callback args

---
 cccli/command/command.py | 2 +-
 cccli/command/host.py    | 5 ++---
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/cccli/command/command.py b/cccli/command/command.py
index d7120e8..5cc2933 100644
--- a/cccli/command/command.py
+++ b/cccli/command/command.py
@@ -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:
diff --git a/cccli/command/host.py b/cccli/command/host.py
index f037856..e533fd4 100644
--- a/cccli/command/host.py
+++ b/cccli/command/host.py
@@ -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'''
-- 
GitLab