From b2fe3f2d612fff70c94fcd83a4eac13907aea016 Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Wed, 15 Jul 2020 22:04:22 -0400 Subject: [PATCH] [ussuri] 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 --- 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 8d117e6c9..57e668de5 100644 --- a/tripleo_ansible/ansible_plugins/modules/paunch.py +++ b/tripleo_ansible/ansible_plugins/modules/paunch.py @@ -178,6 +178,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