rjancewicz / python-kadmin

Python module for kerberos admin (kadm5)
MIT License
35 stars 40 forks source link

Make getprinc raise an exception on insufficient privileges #39

Closed michaelweiser closed 9 years ago

michaelweiser commented 9 years ago

Previously, getprinc would silently failed if permissions were missing. With this change, such errors can nicely be detected by the user using code such as:

try: return kadm.getprinc(princ) except kadmin.AuthGetError: ...

rjancewicz commented 9 years ago

This looks fine, it is likely that a universal get_princ wrapper should implement this exception for all locations where the principal is retrieved from the server.