...so that owners can ask if their request got
granted already.

Signed-off-by: Klaus Aehlig <[email protected]>
---
 src/Ganeti/WConfd/Core.hs | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/Ganeti/WConfd/Core.hs b/src/Ganeti/WConfd/Core.hs
index 90504a2..c8574db 100644
--- a/src/Ganeti/WConfd/Core.hs
+++ b/src/Ganeti/WConfd/Core.hs
@@ -189,6 +189,10 @@ tryUpdateLocks cid req =
   . (>>= toErrorStr)
   $ modifyLockWaiting (LW.updateLocks cid (fromGanetiLockRequest req))
 
+-- | Tell whether a given owner has pending requests.
+hasPendingRequest :: ClientId -> WConfdMonad Bool
+hasPendingRequest cid = liftM (LW.hasPendingRequest cid) readLockWaiting
+
 -- | Free all locks of a given owner (i.e., a job-id lockfile pair).
 freeLocks :: ClientId -> WConfdMonad ()
 freeLocks cid =
@@ -247,4 +251,5 @@ exportedFunctions = [ 'echo
                     , 'downGradeLocksLevel
                     , 'intersectLocks
                     , 'opportunisticLockUnion
+                    , 'hasPendingRequest
                     ]
-- 
1.9.1.423.g4596e3a

Reply via email to