#6506 Make ipapython.kerberos.Principal.__repr__ show the actual principal name
Closed: Duplicate 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')"

Metadata Update from @mbabinsk:
- Issue assigned to someone
- Issue set to the milestone: 0.0 NEEDS_TRIAGE

7 years ago

Login to comment on this ticket.

Metadata