convert run dir mode to constant
authorGuido Trotter <ultrotter@google.com>
Wed, 26 Nov 2008 16:49:19 +0000 (16:49 +0000)
committerGuido Trotter <ultrotter@google.com>
Wed, 26 Nov 2008 16:49:19 +0000 (16:49 +0000)
ganeti-noded used to create all directories under /var/run with an
hard-coded mode. convert it to a constant.

Reviewed-by: imsnah

daemons/ganeti-noded
lib/constants.py

index 5b83428..aa25c7b 100755 (executable)
@@ -664,7 +664,7 @@ def EnsureRuntimeEnvironment():
   packaging.
 
   """
-  dirs = [(val, 0755) for val in constants.SUB_RUN_DIRS]
+  dirs = [(val, constants.RUN_DIRS_MODE) for val in constants.SUB_RUN_DIRS]
   dirs.append((constants.LOG_OS_DIR, 0750))
   for dir_name, dir_mode in dirs:
     if not os.path.exists(dir_name):
index 2a6a4c3..251e002 100644 (file)
@@ -84,6 +84,7 @@ RUN_DIR = _autoconf.LOCALSTATEDIR + "/run"
 RUN_GANETI_DIR = RUN_DIR + "/ganeti"
 BDEV_CACHE_DIR = RUN_GANETI_DIR + "/bdev-cache"
 DISK_LINKS_DIR = RUN_GANETI_DIR + "/instance-disks"
+RUN_DIRS_MODE = 0755
 SOCKET_DIR = RUN_GANETI_DIR + "/socket"
 SOCKET_DIR_MODE = 0700
 # keep RUN_GANETI_DIR first here, to make sure all get created when the node