Merge "Correct perms of /var/run/heat-config/heat-config"

This commit is contained in:
Jenkins 2016-07-29 09:09:51 +00:00 committed by Gerrit Code Review
commit 051822a179
3 changed files with 5 additions and 6 deletions
hot/software-config/elements/heat-config
install.d
os-refresh-config/configure.d

@ -1,5 +0,0 @@
#!/bin/bash
set -eux
SCRIPTDIR=$(dirname $0)
install -D -g root -o root -m 0600 ${SCRIPTDIR}/heat-config /var/run/heat-config/heat-config

@ -16,6 +16,7 @@ import json
import logging
import os
import shutil
import stat
import subprocess
import sys
@ -46,6 +47,10 @@ def main(argv=sys.argv):
log.error('No config file %s' % CONF_FILE)
return 1
conf_mode = stat.S_IMODE(os.lstat(CONF_FILE).st_mode)
if conf_mode != 0o600:
os.chmod(CONF_FILE, 0o600)
if not os.path.isdir(DEPLOYED_DIR):
if DEPLOYED_DIR != OLD_DEPLOYED_DIR and os.path.isdir(OLD_DEPLOYED_DIR):
log.debug('Migrating deployed state from %s to %s' %