Skip to content

Commit

Permalink
icinga2_host: fix a key error when modifying an existing host (#6748)
Browse files Browse the repository at this point in the history
* Initialize `template` variable. Add changelog fragment.

* Update changelogs/fragments/6286-icinga2_host-template-and-template-vars.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

* icinga2_host: fix a key error when updating a host

* Changelog fragment.

* Update changelog fragment with correct PR number.

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 806f6da)
  • Loading branch information
yoannlr authored and patchback[bot] committed Jun 20, 2023
1 parent ba559d2 commit 4d6a3f9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions changelogs/fragments/6748-icinga2_host-datafix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- "icinga2_host - fix a key error when updating an existing host (https://github.com/ansible-collections/community.general/pull/6748)."
2 changes: 1 addition & 1 deletion plugins/modules/icinga2_host.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ def main():
module.exit_json(changed=False, name=name, data=data)

# Template attribute is not allowed in modification
del data['attrs']['templates']
del data['templates']

ret = icinga.modify(name, data)

Expand Down

0 comments on commit 4d6a3f9

Please sign in to comment.