#6505 Make ipapython.kerberos.Principal.__repr__ show the actual principal name
Closed: Fixed None Opened 7 years ago by mbabinsk.

Minor usability enhancement: override repr methdo to actually show the contained principal name in order to ease debugging. See example:

>>> from ipapython.kerberos import Principal
>>> p = Principal((u'HTTP', u'master1.ipa.test'), u'IPA.TEST')
>>> p
<ipapython.kerberos.Principal object at 0x7f5315026c50>
>>> def repr(obj):
...  return "{}.{}('{}')".format(obj.__module__, obj.__class__.__name__, obj.__str__())
>>> p.__repr__ = repr
>>> p
<ipapython.kerberos.Principal object at 0x7f5315026c50>
>>> repr(p)
"ipapython.kerberos.Principal('HTTP/master1.ipa.test@IPA.TEST')"

master:

  • 38cc40d Enhance repr method of Principal

Metadata Update from @mbabinsk:
- Issue assigned to someone
- Issue set to the milestone: FreeIPA 4.5

7 years ago

Login to comment on this ticket.

Metadata