Skip to content
Snippets Groups Projects
Commit 195c7f91 authored by Iustin Pop's avatar Iustin Pop
Browse files

Create all SUB_RUN_DIRS in ganeti-noded

Rather than just creating BDEV_CACHE_DIR we loop through the
SUB_RUN_DIRS list and create all its childs.

Reviewed-by: iustinp
parent 75afaefc
No related branches found
No related tags found
No related merge requests found
...@@ -609,20 +609,20 @@ def main(): ...@@ -609,20 +609,20 @@ def main():
print "Cluster configuration incomplete: '%s'" % str(err) print "Cluster configuration incomplete: '%s'" % str(err)
sys.exit(5) sys.exit(5)
# create /var/run/ganeti if not existing, in order to take care of # create the various SUB_RUN_DIRS, if not existing, so that we handle the
# tmpfs /var/run # situation where RUN_DIR is tmpfs
if not os.path.exists(constants.BDEV_CACHE_DIR): for dir_name in constants.SUB_RUN_DIRS:
try: if not os.path.exists(dir_name):
os.mkdir(constants.BDEV_CACHE_DIR, 0755) try:
except EnvironmentError, err: os.mkdir(dir_name, 0755)
if err.errno != errno.EEXIST: except EnvironmentError, err:
print ("Node setup wrong, cannot create directory %s: %s" % if err.errno != errno.EEXIST:
(constants.BDEV_CACHE_DIR, err)) print ("Node setup wrong, cannot create directory %s: %s" %
sys.exit(5) (dir_name, err))
if not os.path.isdir(constants.BDEV_CACHE_DIR): sys.exit(5)
print ("Node setup wrong, %s is not a directory" % if not os.path.isdir(dir_name):
constants.BDEV_CACHE_DIR) print ("Node setup wrong, %s is not a directory" % dir_name)
sys.exit(5) sys.exit(5)
# become a daemon # become a daemon
if options.fork: if options.fork:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment