Fixup directory creation process

This commit is contained in:
James Page 2016-11-10 10:14:16 +00:00
parent 8f090fa8ad
commit 4bd46300a3
1 changed files with 6 additions and 4 deletions

View File

@ -73,10 +73,12 @@ class OpenStackSnap():
renderer = SnapFileRenderer()
LOG.info(setup)
for dir in setup['dirs']:
LOG.info('Ensuring directory {} exists'.format(dir))
dir_name = dir.format(**self.snap_env)
ensure_dir(dir_name)
for directory in setup['dirs']:
dir_name = directory.format(**self.snap_env)
LOG.info('Ensuring directory {} exists'.format(dir_name))
if not os.path.exists(dir_name):
LOG.info('Creating directory {}'.format(dir_name))
os.makedirs(dir_name, 0o750)
for template in setup['templates']:
target = setup['templates'][template]