Add afs.pts.PTS.getEntryFromKrbname, which converts a Kerberos
authorEvan Broder <broder@mit.edu>
Sun, 22 Nov 2009 23:19:48 +0000 (18:19 -0500)
committerEvan Broder <broder@mit.edu>
Sun, 22 Nov 2009 23:20:24 +0000 (18:20 -0500)
principal to an AFS principal.

(This exposes afs._pts.PTS._Krb5ToAfs)

Signed-off-by: Evan Broder <broder@mit.edu>

afs/pts.py

index 47346f7..8bee97e 100644 (file)
@@ -354,6 +354,14 @@ class PTS(_pts.PTS):
         else:
             return PTEntry(self, id=ident)
 
         else:
             return PTEntry(self, id=ident)
 
+    def getEntryFromKrbname(self, ident):
+        """Retrieve a PTEntry matching a given Kerberos v5 principal.
+
+        getEntryFromKrb accepts a krb5 principal, converts it to the
+        equivalent AFS principal, and returns a PTEntry for that
+        principal."""
+        return self.getEntry(self._Krb5ToAfs(ident))
+
     def expire(self):
         """Flush the cache of PTEntry objects.
 
     def expire(self):
         """Flush the cache of PTEntry objects.