locking.GLM: Allow adding locks to monitor
authorMichael Hanselmann <hansmi@google.com>
Thu, 21 Jul 2011 08:49:21 +0000 (10:49 +0200)
committerMichael Hanselmann <hansmi@google.com>
Thu, 21 Jul 2011 11:55:31 +0000 (13:55 +0200)
This will be used for exporting job dependencies through
the lock monitor.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

lib/locking.py

index 87d4e23..1b46e5f 100644 (file)
@@ -1449,6 +1449,14 @@ class GanetiLockManager:
                               monitor=self._monitor),
       }
 
+  def AddToLockMonitor(self, provider):
+    """Registers a new lock with the monitor.
+
+    See L{LockMonitor.RegisterLock}.
+
+    """
+    return self._monitor.RegisterLock(provider)
+
   def QueryLocks(self, fields):
     """Queries information from all locks.