LockedUid: add GetUid() method
authorGuido Trotter <ultrotter@google.com>
Mon, 19 Apr 2010 15:24:37 +0000 (16:24 +0100)
committerGuido Trotter <ultrotter@google.com>
Tue, 20 Apr 2010 15:45:19 +0000 (16:45 +0100)
uidpool users that get passed a LockedUid by the uidpool need to know
which one the uid is. Since it's not nice to make them access a private
member, and we shouldn't make "uid" public either, we'll add a getter
method.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

lib/uidpool.py

index 9e3c8e5..a74cbd0 100644 (file)
@@ -215,6 +215,9 @@ class LockedUid(object):
     # Release the exclusive lock and close the filedescriptor
     self._lock.Close()
 
+  def GetUid(self):
+    return self._uid
+
   def __str__(self):
     return "%s" % self._uid