Ensure files exist before building/uploading plan
Until now, only environment files were tested for their eXistenZ. This
patch corrects this issue, allowing to get a graceful failure before
plan is compiled and uploaded.
The following files are now checked, and deploy will gracefully fail in
case of non-existing file:
- plan-environment-file
- answers-file
- networks-file
No Bioport nor Pod was harmed for this patch.
Change-Id: Ifd4229b68571fd6b91574675c1f04d7b5c755eab
Closes-Bug: #1834307
(cherry picked from commit bd354f1fc8
)
This commit is contained in:
parent
7d41f81eca
commit
f78809a3e3
@ -539,6 +539,22 @@ class DeployOvercloud(command.Command):
|
|||||||
if not os.path.isfile(env_file.replace(".yaml",
|
if not os.path.isfile(env_file.replace(".yaml",
|
||||||
".j2.yaml")):
|
".j2.yaml")):
|
||||||
nonexisting_envs.append(env_file)
|
nonexisting_envs.append(env_file)
|
||||||
|
|
||||||
|
# Check networks_file existence
|
||||||
|
if parsed_args.networks_file:
|
||||||
|
if not os.path.isfile(parsed_args.networks_file):
|
||||||
|
nonexisting_envs.append(parsed_args.networks_file)
|
||||||
|
|
||||||
|
# check plan_environment_file existence
|
||||||
|
if parsed_args.plan_environment_file:
|
||||||
|
if not os.path.isfile(parsed_args.plan_environment_file):
|
||||||
|
nonexisting_envs.append(parsed_args.plan_environment_file)
|
||||||
|
|
||||||
|
# check answers_file existence
|
||||||
|
if parsed_args.answers_file:
|
||||||
|
if not os.path.isfile(parsed_args.answers_file):
|
||||||
|
nonexisting_envs.append(parsed_args.answers_file)
|
||||||
|
|
||||||
if jinja2_envs:
|
if jinja2_envs:
|
||||||
rewritten_paths = [e.replace(".j2.yaml", ".yaml")
|
rewritten_paths = [e.replace(".j2.yaml", ".yaml")
|
||||||
for e in jinja2_envs]
|
for e in jinja2_envs]
|
||||||
|
Loading…
Reference in New Issue
Block a user