Package ganeti :: Package utils :: Module livelock
[hide private]
[frames] | no frames]

Module livelock

source code

Lockfiles to prove liveliness

When requesting resources, like locks, from wconfd, requesters have to provide the name of a file they own an exclusive lock on, to prove that they are still alive. Provide methods to obtain such a file.

Classes [hide private]
  LiveLockName
  LiveLock
Utility for a lockfile needed to request resources from WconfD.
Functions [hide private]
 
GuessLockfileFor(name)
For a given name, take the latest file matching.
source code

Imports: fcntl, os, struct, time, NiceSort, pathutils


Function Details [hide private]

GuessLockfileFor(name)

source code 

For a given name, take the latest file matching.

Returns:
the file with the latest name matching the given prefix in LIVELOCK_DIR, or the plain name, if none exists.