summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ipalib/cli.py4
-rw-r--r--ipalib/frontend.py9
2 files changed, 4 insertions, 9 deletions
diff --git a/ipalib/cli.py b/ipalib/cli.py
index 07956e0a7..7148afc1c 100644
--- a/ipalib/cli.py
+++ b/ipalib/cli.py
@@ -301,7 +301,9 @@ class CLI(object):
break
except errors.ValidationError, e:
error = e.error
- cmd.output_for_cli(cmd(**kw))
+ ret = cmd(**kw)
+ if callable(cmd.output_for_cli):
+ cmd.output_for_cli(ret)
def parse(self, cmd, argv):
parser = self.build_parser(cmd)
diff --git a/ipalib/frontend.py b/ipalib/frontend.py
index 2c34b9722..af640cb59 100644
--- a/ipalib/frontend.py
+++ b/ipalib/frontend.py
@@ -496,6 +496,7 @@ class Command(plugable.Plugin):
args = None
options = None
params = None
+ output_for_cli = None
def __call__(self, *args, **kw):
"""
@@ -745,14 +746,6 @@ class Command(plugable.Plugin):
multivalue = True
yield arg
- def output_for_cli(self, ret):
- """
- Output result of this command to command line interface.
- """
- assert type(ret) is dict, 'base output_for_cli() only works with dict'
- for key in sorted(ret):
- print '%s = %r' % (key, ret[key])
-
class Object(plugable.Plugin):
__public__ = frozenset((