Browse Source

[train] paunch: exit module if config doesn't exist

It's possible that the step directory doesn't exist in a deployment,
just quit the module with no change and move on.

It'll avoid running paunch with empty config.
This will be backported to Train.

Change-Id: I3a5fc2214e7068f1e7aacc0e7a8a681c3f9715e9
(cherry picked from commit b2fe3f2d61)
changes/56/741356/2
Emilien Macchi 2 weeks ago
parent
commit
8b6924bb70
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      tripleo_ansible/ansible_plugins/modules/paunch.py

+ 3
- 0
tripleo_ansible/ansible_plugins/modules/paunch.py View File

@@ -166,6 +166,9 @@ class PaunchManager:
log_file=self.log_file)

if self.config:
# Do nothing if config path doesn't exist
if not os.path.exists(self.config):
self.module.exit_json(**self.results)
if self.config.endswith('.json'):
self.module.warn('Only one config was given, cleanup disabled')
self.cleanup = False


Loading…
Cancel
Save