Add a top level RUN_GANETI_DIR constant
authorIustin Pop <iustin@google.com>
Tue, 8 Jul 2008 14:42:05 +0000 (14:42 +0000)
committerIustin Pop <iustin@google.com>
Tue, 8 Jul 2008 14:42:05 +0000 (14:42 +0000)
This patch creates a base RUN_GANETI_DIR and then moves the other run
dir constants to use that (even if just setting BDEV_CACHE_DIR as equal
to it, rather than putting it deeper, for now).

Also we create a constant list of all the subdirs we need in RUN_DIR to
work properly, which we'll use when creating them in ganeti-noded.

Reviewed-by: iustinp

lib/constants.py

index de8dd48..327c8e4 100644 (file)
@@ -80,8 +80,12 @@ CONFIG_VERSION = BuildVersion(CONFIG_MAJOR, CONFIG_MINOR, CONFIG_REVISION)
 # file paths
 DATA_DIR = _autoconf.LOCALSTATEDIR + "/lib/ganeti"
 RUN_DIR = _autoconf.LOCALSTATEDIR + "/run"
-BDEV_CACHE_DIR = RUN_DIR + "/ganeti"
-DISK_LINKS_DIR = RUN_DIR + "/ganeti/instance-disks"
+RUN_GANETI_DIR = RUN_DIR + "/ganeti"
+BDEV_CACHE_DIR = RUN_GANETI_DIR # TODO(2.0): move deeper
+DISK_LINKS_DIR = RUN_GANETI_DIR + "/instance-disks"
+# keep RUN_GANETI_DIR first here, to make sure all get created when the node
+# daemon is started (this takes care of RUN_DIR being tmpfs)
+SUB_RUN_DIRS = [ RUN_GANETI_DIR, BDEV_CACHE_DIR, DISK_LINKS_DIR ]
 LOCK_DIR = _autoconf.LOCALSTATEDIR + "/lock"
 CLUSTER_CONF_FILE = DATA_DIR + "/config.data"
 SSL_CERT_FILE = DATA_DIR + "/server.pem"