Merge "Fix populate_image_vars for bootstrap node"

This commit is contained in:
Jenkins 2015-01-13 21:33:18 +00:00 committed by Gerrit Code Review
commit a60e01c0da
1 changed files with 15 additions and 0 deletions

View File

@ -137,6 +137,21 @@ def main(argv):
) as out:
out.write(yaml.dump(existing, default_flow_style=False))
os.rename(out.name, output_path)
# The conditionals and resulting symlink below is to support the
# execution of the playbook steps with-in the bootstrap node context
# when a user utilizes this script and does not define the controller
# disk image id as a global variable on the playbook command line.
if os.path.isfile(os.path.join(
args.output_dir,
'controller'
)) and not os.path.islink(os.path.join(
args.output_dir,
'controller-bootstrap')):
os.symlink(
'controller',
os.path.join(args.output_dir, 'controller-bootstrap')
)
if __name__ == '__main__':
sys.exit(main(sys.argv))