From 7b7566d7030c3ed498e4e263d379096b8b02b5e3 Mon Sep 17 00:00:00 2001 From: Donien <88634789+Donien@users.noreply.github.com> Date: Mon, 27 Jul 2026 17:32:54 +0200 Subject: [PATCH] Fix potentially meaningless error message in `icinga2_object` on KeyError --- plugins/action/icinga2_object.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/action/icinga2_object.py b/plugins/action/icinga2_object.py index 56afca96..fab91f49 100644 --- a/plugins/action/icinga2_object.py +++ b/plugins/action/icinga2_object.py @@ -46,10 +46,10 @@ def run(self, tmp=None, task_vars=None): tmp=tmp ) - if 'failed' in obj and obj['failed']: - raise AnsibleError('Call to module failed: %s' % obj['msg']) - if 'skipped' in obj and obj['skipped']: - raise AnsibleError('Call to module was skipped: %s' % obj['msg']) + if obj.get('failed', False): + raise AnsibleError('Call to module failed: %s' % obj.get('msg', obj)) + if obj.get('skipped', False): + raise AnsibleError('Call to module was skipped: %s' % obj.get('msg', obj)) # # file path handling for assemble