[PR #7998/4947786d backport][stable-8] Adds group_by_hostgroups parameter to Icinga2 inventory (#8134)

Adds group_by_hostgroups parameter to Icinga2 inventory (#7998)

* (lots of commit messages)

---------

Co-authored-by: Gianluca Salvo <gianluca.salvo@gruppomol.it>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 4947786d36)

Co-authored-by: Gianluca Salvo <Gianlu@users.noreply.github.com>
This commit is contained in:
patchback[bot] 2024-03-24 18:25:52 +01:00 committed by GitHub
commit c494fe5824
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 19 additions and 5 deletions

View file

@ -86,6 +86,8 @@ def get_option(option):
return {}
elif option == 'strict':
return False
elif option == 'group_by_hostgroups':
return True
else:
return None
@ -96,6 +98,7 @@ def test_populate(inventory, mocker):
inventory.icinga2_password = 'password'
inventory.icinga2_url = 'https://localhost:5665' + '/v1'
inventory.inventory_attr = "address"
inventory.group_by_hostgroups = True
# bypass authentication and API fetch calls
inventory._check_api = mocker.MagicMock(side_effect=check_api)