diff --git a/lib/constants.py b/lib/constants.py index b09c2ad2d98001620ec2d1e308db10ed93fd47d7..ecc6182f8c2cb8669bfa85fd068b449617140602 100644 --- a/lib/constants.py +++ b/lib/constants.py @@ -34,6 +34,7 @@ EXPORT_VERSION = 0 # file paths DATA_DIR = _autoconf.LOCALSTATEDIR + "/lib/ganeti" BDEV_CACHE_DIR = _autoconf.LOCALSTATEDIR + "/run/ganeti" +LOCK_DIR = _autoconf.LOCALSTATEDIR + "/lock" CLUSTER_CONF_FILE = DATA_DIR + "/config.data" SSL_CERT_FILE = DATA_DIR + "/server.pem" WATCHER_STATEFILE = DATA_DIR + "/watcher.data" diff --git a/lib/utils.py b/lib/utils.py index 68fac3e78291755fabac75c53694a64802810582..a85ebb04873194344559e89aebb072937953e67e 100644 --- a/lib/utils.py +++ b/lib/utils.py @@ -39,6 +39,7 @@ import itertools from ganeti import logger from ganeti import errors +from ganeti import constants _locksheld = [] @@ -95,7 +96,7 @@ class RunResult(object): def _GetLockFile(subsystem): """Compute the file name for a given lock name.""" - return "/var/lock/ganeti_lock_%s" % subsystem + return "%s/ganeti_lock_%s" % (constants.LOCK_DIR, subsystem) def Lock(name, max_retries=None, debug=False):