From b7ed338260d6213976086a03bce349093ab519f8 Mon Sep 17 00:00:00 2001 From: Packit Service Date: Dec 09 2020 07:45:51 +0000 Subject: Apply patch ansible-freeipa-0.1.12-Fixed-error-msgs-on-FreeIPABaseModule-subclasses_rhbz#1845051.patch patch_name: ansible-freeipa-0.1.12-Fixed-error-msgs-on-FreeIPABaseModule-subclasses_rhbz#1845051.patch present_in_specfile: true --- diff --git a/plugins/module_utils/ansible_freeipa_module.py b/plugins/module_utils/ansible_freeipa_module.py index 1e55693..4799e5a 100644 --- a/plugins/module_utils/ansible_freeipa_module.py +++ b/plugins/module_utils/ansible_freeipa_module.py @@ -610,12 +610,15 @@ class FreeIPABaseModule(AnsibleModule): exit the module with proper arguments. """ - if exc_val: - self.fail_json(msg=str(exc_val)) - # TODO: shouldn't we also disconnect from api backend? temp_kdestroy(self.ccache_dir, self.ccache_name) + if exc_type == SystemExit: + raise + + if exc_val: + self.fail_json(msg=str(exc_val)) + self.exit_json(changed=self.changed, user=self.exit_args) def get_command_errors(self, command, result):