Commit 3aecd2c7 authored by Iustin Pop's avatar Iustin Pop
Browse files

Replace hardcoded lock dir

This patch replaces the hardcoded ‘/var/lock/’ directory with one based on
LOCALSTATEDIR.

Reviewed-by: imsnah
parent f362096f
......@@ -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"
......
......@@ -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):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment