summaryrefslogtreecommitdiffstats
path: root/ipalib/frontend.py
diff options
context:
space:
mode:
authorJason Gerard DeRose <jderose@redhat.com>2008-10-14 01:45:30 -0600
committerJason Gerard DeRose <jderose@redhat.com>2008-10-14 01:45:30 -0600
commit1480224724864cb7cf34c9be755b905c61f885b9 (patch)
tree6a5a5deede0e721d8484fe770d62ee53029097d0 /ipalib/frontend.py
parent20fa90cfb6e954040de47551762dfbb7680dba51 (diff)
downloadfreeipa-1480224724864cb7cf34c9be755b905c61f885b9.tar.gz
freeipa-1480224724864cb7cf34c9be755b905c61f885b9.tar.xz
freeipa-1480224724864cb7cf34c9be755b905c61f885b9.zip
Started roughing out user_add() using api.Backend.ldap; added Command.output_for_cli() to take care of formatting print output
Diffstat (limited to 'ipalib/frontend.py')
-rw-r--r--ipalib/frontend.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/ipalib/frontend.py b/ipalib/frontend.py
index 65b053e6c..da4fd00b1 100644
--- a/ipalib/frontend.py
+++ b/ipalib/frontend.py
@@ -486,6 +486,7 @@ class Command(plugable.Plugin):
'params',
'args_to_kw',
'kw_to_args',
+ 'output_for_cli',
))
takes_options = tuple()
takes_args = tuple()
@@ -741,6 +742,14 @@ 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((