Fix run directory for the fake hypervisor
authorIustin Pop <iustin@google.com>
Mon, 28 Jan 2008 14:41:35 +0000 (14:41 +0000)
committerIustin Pop <iustin@google.com>
Mon, 28 Jan 2008 14:41:35 +0000 (14:41 +0000)
Currently the fake hypervisor has hardcoded ‘/var/run’ as a base
directory for its store. This patch adds a constant RUN_DIR that is used
for both the fake hypervisor and for BDEV_CACHE_DIR.

Reviewed-by: ultrotter

lib/constants.py
lib/hypervisor.py

index 81876dd..3b764e2 100644 (file)
@@ -33,7 +33,8 @@ EXPORT_VERSION = 0
 
 # file paths
 DATA_DIR = _autoconf.LOCALSTATEDIR + "/lib/ganeti"
-BDEV_CACHE_DIR = _autoconf.LOCALSTATEDIR + "/run/ganeti"
+RUN_DIR = _autoconf.LOCALSTATEDIR + "/run"
+BDEV_CACHE_DIR = RUN_DIR + "/ganeti"
 LOCK_DIR = _autoconf.LOCALSTATEDIR + "/lock"
 CLUSTER_CONF_FILE = DATA_DIR + "/config.data"
 SSL_CERT_FILE = DATA_DIR + "/server.pem"
index e77e4b8..c7f1ce0 100644 (file)
@@ -404,7 +404,7 @@ class FakeHypervisor(BaseHypervisor):
   a real virtualisation software installed.
 
   """
-  _ROOT_DIR = "/var/run/ganeti-fake-hypervisor"
+  _ROOT_DIR = constants.RUN_DIR + "/ganeti-fake-hypervisor"
 
   def __init__(self):
     BaseHypervisor.__init__(self)