-def EnsureRuntimeEnvironment():
- """Ensure our run-time environment is complete.
-
- Currently this creates directories which could be missing, either
- due to directories being on a tmpfs mount, or due to incomplete
- packaging.
-
- """
- 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):
- try:
- os.mkdir(dir_name, dir_mode)
- except EnvironmentError, err:
- if err.errno != errno.EEXIST:
- print ("Node setup wrong, cannot create directory '%s': %s" %
- (dir_name, err))
- sys.exit(5)
- if not os.path.isdir(dir_name):
- print ("Node setup wrong, '%s' is not a directory" % dir_name)
- sys.exit(5)
-
-