From 8b6924bb706a1f9385ad0ffc048ef82830e854e2 Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Wed, 15 Jul 2020 22:04:22 -0400 Subject: [PATCH] [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 b2fe3f2d612fff70c94fcd83a4eac13907aea016) --- tripleo_ansible/ansible_plugins/modules/paunch.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tripleo_ansible/ansible_plugins/modules/paunch.py b/tripleo_ansible/ansible_plugins/modules/paunch.py index 41e051d7b..6b30ac468 100644 --- a/tripleo_ansible/ansible_plugins/modules/paunch.py +++ b/tripleo_ansible/ansible_plugins/modules/paunch.py @@ -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