Merge "Move heat_launcher data to /var/log/heat-launcher"
This commit is contained in:
commit
ac215a9ae4
|
@ -112,34 +112,34 @@ class HeatBaseLauncher(object):
|
||||||
# and chown them accordingly for the heat user
|
# and chown them accordingly for the heat user
|
||||||
def __init__(self, api_port, container_image, user='heat'):
|
def __init__(self, api_port, container_image, user='heat'):
|
||||||
self.api_port = api_port
|
self.api_port = api_port
|
||||||
tmpdir = '/var/tmp/undercloud'
|
heatdir = '/var/log/heat-launcher'
|
||||||
|
|
||||||
if os.path.isdir(tmpdir):
|
if os.path.isdir(heatdir):
|
||||||
# This one may fail but it's just cleanup.
|
# This one may fail but it's just cleanup.
|
||||||
p = subprocess.Popen(['umount', tmpdir],
|
p = subprocess.Popen(['umount', heatdir],
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.PIPE)
|
stderr=subprocess.PIPE)
|
||||||
cmd_stdout, cmd_stderr = p.communicate()
|
cmd_stdout, cmd_stderr = p.communicate()
|
||||||
retval = p.returncode
|
retval = p.returncode
|
||||||
if retval != 0:
|
if retval != 0:
|
||||||
log.info('Cleanup unmount of %s failed (probably because '
|
log.info('Cleanup unmount of %s failed (probably because '
|
||||||
'it was not mounted): %s' % (tmpdir, cmd_stderr))
|
'it was not mounted): %s' % (heatdir, cmd_stderr))
|
||||||
else:
|
else:
|
||||||
log.info('umount of %s success' % (tmpdir))
|
log.info('umount of %s success' % (heatdir))
|
||||||
else:
|
else:
|
||||||
# Create the directory if it doesn't exist.
|
# Create the directory if it doesn't exist.
|
||||||
try:
|
try:
|
||||||
os.makedirs(tmpdir, mode=0o755)
|
os.makedirs(heatdir, mode=0o700)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log.error('Creating temp directory "%s" failed: %s' %
|
log.error('Creating temp directory "%s" failed: %s' %
|
||||||
(tmpdir, e))
|
(heatdir, e))
|
||||||
raise Exception('Could not create temp directory %s: %s' %
|
raise Exception('Could not create temp directory %s: %s' %
|
||||||
(tmpdir, e))
|
(heatdir, e))
|
||||||
# As an optimization we mount the tmp directory in a tmpfs (in memory)
|
# As an optimization we mount the tmp directory in a tmpfs (in memory)
|
||||||
# filesystem. Depending on your system this can cut the heat
|
# filesystem. Depending on your system this can cut the heat
|
||||||
# deployment times by half.
|
# deployment times by half.
|
||||||
p = subprocess.Popen(['mount', '-t', 'tmpfs', '-o', 'size=500M',
|
p = subprocess.Popen(['mount', '-t', 'tmpfs', '-o', 'size=500M',
|
||||||
'tmpfs', tmpdir],
|
'tmpfs', heatdir],
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.PIPE)
|
stderr=subprocess.PIPE)
|
||||||
cmd_stdout, cmd_stderr = p.communicate()
|
cmd_stdout, cmd_stderr = p.communicate()
|
||||||
|
@ -148,12 +148,12 @@ class HeatBaseLauncher(object):
|
||||||
# It's ok if this fails, it will still work. It just won't
|
# It's ok if this fails, it will still work. It just won't
|
||||||
# be on tmpfs.
|
# be on tmpfs.
|
||||||
log.warning('Unable to mount tmpfs for logs and database %s: %s' %
|
log.warning('Unable to mount tmpfs for logs and database %s: %s' %
|
||||||
(tmpdir, cmd_stderr))
|
(heatdir, cmd_stderr))
|
||||||
|
|
||||||
self.policy_file = os.path.join(os.path.dirname(__file__),
|
self.policy_file = os.path.join(os.path.dirname(__file__),
|
||||||
'noauth_policy.json')
|
'noauth_policy.json')
|
||||||
self.install_tmp = tempfile.mkdtemp(prefix='%s/undercloud_deploy-' %
|
self.install_tmp = tempfile.mkdtemp(prefix='%s/undercloud_deploy-' %
|
||||||
tmpdir)
|
heatdir)
|
||||||
self.container_image = container_image
|
self.container_image = container_image
|
||||||
self.user = user
|
self.user = user
|
||||||
self.sql_db = os.path.join(self.install_tmp, 'heat.sqlite')
|
self.sql_db = os.path.join(self.install_tmp, 'heat.sqlite')
|
||||||
|
|
Loading…
Reference in New Issue