Browse Source

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)
(cherry picked from commit f78809a3e3)
(cherry picked from commit cb976f6729)
tags/9.3.1
Cédric Jeanneret 2 months ago
parent
commit
9e5ec97754
1 changed files with 16 additions and 0 deletions
  1. 16
    0
      tripleoclient/v1/overcloud_deploy.py

+ 16
- 0
tripleoclient/v1/overcloud_deploy.py View File

@@ -592,6 +592,22 @@ class DeployOvercloud(command.Command):
592 592
                     if not os.path.isfile(env_file.replace(".yaml",
593 593
                                                            ".j2.yaml")):
594 594
                         nonexisting_envs.append(env_file)
595
+
596
+            # Check networks_file existence
597
+            if parsed_args.networks_file:
598
+                if not os.path.isfile(parsed_args.networks_file):
599
+                    nonexisting_envs.append(parsed_args.networks_file)
600
+
601
+            # check plan_environment_file existence
602
+            if parsed_args.plan_environment_file:
603
+                if not os.path.isfile(parsed_args.plan_environment_file):
604
+                    nonexisting_envs.append(parsed_args.plan_environment_file)
605
+
606
+            # check answers_file existence
607
+            if parsed_args.answers_file:
608
+                if not os.path.isfile(parsed_args.answers_file):
609
+                    nonexisting_envs.append(parsed_args.answers_file)
610
+
595 611
             if jinja2_envs:
596 612
                 rewritten_paths = [e.replace(".j2.yaml", ".yaml")
597 613
                                    for e in jinja2_envs]

Loading…
Cancel
Save