Improve LDAPEntry.__repr__ for freshly created entries

Creating a LDAPEntry from dict does not set the raw entries,
to display everything we need to combine the underlying data.

https://fedorahosted.org/freeipa/ticket/4015
This commit is contained in:
Petr Viktorin committed 2013-11-26 13:19:37 +01:00
1 parent f20577ddc4
commit 76c7f24919
1 file changed
+3 -1
+3 -1
View File
@@ -719,7 +719,9 @@ class LDAPEntry(collections.MutableMapping):
return self._orig
def __repr__(self):
return '%s(%r, %r)' % (type(self).__name__, self._dn, self._raw)
data = dict(self._raw)
data.update((k, v) for k, v in self._nice.iteritems() if v is not None)
return '%s(%r, %r)' % (type(self).__name__, self._dn, data)
def copy(self):
return LDAPEntry(self)