summaryrefslogtreecommitdiffstats
path: root/ipalib/plugins/user.py
diff options
context:
space:
mode:
authorJan Cholasta <jcholast@redhat.com>2013-01-31 11:19:13 +0100
committerMartin Kosek <mkosek@redhat.com>2013-03-01 16:59:46 +0100
commitbb36683c8480a68d54ef632daa0a4d6df9802187 (patch)
tree00c9652ad120eb4d3a0c3807025615ecbb0d03f1 /ipalib/plugins/user.py
parent982b78277755a301e3baa1d4f2bd7e1663fb88a5 (diff)
downloadfreeipa-bb36683c8480a68d54ef632daa0a4d6df9802187.tar.gz
freeipa-bb36683c8480a68d54ef632daa0a4d6df9802187.tar.xz
freeipa-bb36683c8480a68d54ef632daa0a4d6df9802187.zip
Use the dn attribute of LDAPEntry to set/get DNs of entries.
Convert all code that uses the 'dn' key of LDAPEntry for this to use the dn attribute instead.
Diffstat (limited to 'ipalib/plugins/user.py')
-rw-r--r--ipalib/plugins/user.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/ipalib/plugins/user.py b/ipalib/plugins/user.py
index 80bdc39e2..979ade1a7 100644
--- a/ipalib/plugins/user.py
+++ b/ipalib/plugins/user.py
@@ -838,15 +838,14 @@ class user_status(LDAPQuery):
other_ldap.connect(ccache=os.environ['KRB5CCNAME'])
except Exception, e:
self.error("user_status: Connecting to %s failed with %s" % (host, str(e)))
- newresult = dict()
- newresult['dn'] = dn
+ newresult = ldap.make_entry(dn)
newresult['server'] = _("%(host)s failed: %(error)s") % dict(host=host, error=str(e))
entries.append(newresult)
count += 1
continue
try:
entry = other_ldap.get_entry(dn, attr_list)
- newresult = dict()
+ newresult = ldap.make_entry(dn)
for attr in ['krblastsuccessfulauth', 'krblastfailedauth']:
newresult[attr] = entry[1].get(attr, [u'N/A'])
newresult['krbloginfailedcount'] = entry[1].get('krbloginfailedcount', u'0')
@@ -860,7 +859,6 @@ class user_status(LDAPQuery):
except Exception, e:
self.debug("time conversion failed with %s" % str(e))
pass
- newresult['dn'] = dn
newresult['server'] = host
if options.get('raw', False):
time_format = '%Y%m%d%H%M%SZ'
@@ -876,8 +874,7 @@ class user_status(LDAPQuery):
self.obj.handle_not_found(*keys)
except Exception, e:
self.error("user_status: Retrieving status for %s failed with %s" % (dn, str(e)))
- newresult = dict()
- newresult['dn'] = dn
+ newresult = ldap.make_entry(dn)
newresult['server'] = _("%(host)s failed") % dict(host=host)
entries.append(newresult)
count += 1