summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2008-10-21 09:31:44 -0400
committerRob Crittenden <rcritten@redhat.com>2008-10-21 09:32:48 -0400
commit475265ed378cd0879d22e2b9bc59f7eab742fee9 (patch)
tree28247ce0ed3856b3cacee1c56bf80b79fe0237a0
parent6b998ed479958ec288bafa6075bb7dc03641fa48 (diff)
downloadfreeipa-475265ed378cd0879d22e2b9bc59f7eab742fee9.tar.gz
freeipa-475265ed378cd0879d22e2b9bc59f7eab742fee9.tar.xz
freeipa-475265ed378cd0879d22e2b9bc59f7eab742fee9.zip
Implement --all option to display all attributes.
Still need to strip the dn when not doing all.
-rw-r--r--ipalib/plugins/f_user.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/ipalib/plugins/f_user.py b/ipalib/plugins/f_user.py
index 6aebddfa4..972ee0751 100644
--- a/ipalib/plugins/f_user.py
+++ b/ipalib/plugins/f_user.py
@@ -265,6 +265,9 @@ api.register(user_find)
class user_show(crud.Get):
'Examine an existing user.'
+ takes_options = (
+ Param('all?', type=ipa_types.Bool(), doc='Display all user attributes'),
+ )
def execute(self, uid, **kw):
"""
Execute the user-show operation.
@@ -275,12 +278,15 @@ class user_show(crud.Get):
Returns the entry
:param uid: The login name of the user to retrieve.
- :param kw: Not used.
+ :param kw: "all" set to True = return all attributes
"""
ldap = self.api.Backend.ldap
dn = ldap.find_entry_dn("uid", uid)
# FIXME: should kw contain the list of attributes to display?
- return ldap.retrieve(dn)
+ if kw.get('all', False):
+ return ldap.retrieve(dn)
+ else:
+ return ldap.retrieve(dn, ['uid','givenname','sn','homeDirectory','loginshell'])
def output_for_cli(self, user):
if user:
for a in user.keys():