Merge "In process-templates script write output files to provided dir when using base path"

This commit is contained in:
Zuul 2018-10-02 21:46:04 +00:00 committed by Gerrit Code Review
commit 5441c5fbd0
1 changed files with 5 additions and 1 deletions

View File

@ -158,7 +158,11 @@ def process_templates(template_path, role_data_path, output_dir,
# the command multiple times with the same output_dir.
out_dir = subdir
if output_dir:
out_dir = os.path.join(output_dir, subdir)
if template_path != '.':
# strip out base path if not default
temp = out_dir.split(template_path)[1]
out_dir = temp[1:] if temp.startswith('/') else temp
out_dir = os.path.join(output_dir, out_dir)
if not os.path.exists(out_dir):
os.mkdir(out_dir)