Add user-environment files to archive

This adds the user provided environment files to the archive
which would help in reproducing the deployment with the
archive and the deploy command.

Change-Id: Id5607234b47314d5db36d7caaaeeed19f7d39bd6
This commit is contained in:
ramishra 2021-02-02 09:41:17 +05:30
parent 668ac1222c
commit 16789038c9
1 changed files with 21 additions and 0 deletions

View File

@ -376,6 +376,9 @@ class DeployOvercloud(command.Command):
env_files_tracker=env_files_tracker,
cleanup=(not parsed_args.no_cleanup))
# Copy the env_files to tmp folder for archiving
self._copy_env_files(env_files, tht_root)
if parsed_args.limit:
# check if skip list is defined while using --limit and throw a
# warning if necessary
@ -418,6 +421,24 @@ class DeployOvercloud(command.Command):
self._unprovision_baremetal(parsed_args)
def _copy_env_files(self, files_dict, tht_root):
file_prefix = "file://"
for fullpath in files_dict.keys():
if not fullpath.startswith(file_prefix):
continue
path = fullpath[len(file_prefix):]
if path.startswith(tht_root):
continue
reloc_path = os.path.join(
tht_root,
"user-environments/{}".format(os.path.basename(path)))
utils.safe_write(reloc_path, files_dict[fullpath])
def _try_overcloud_deploy_with_compat_yaml(self, tht_root, stack,
stack_name, parameters,
env_files, timeout,