[PR #8098/d62fe154 backport][stable-8] inventory plugins: make data obtained from remote unsafe (#8146)

inventory plugins: make data obtained from remote unsafe (#8098)

Make data obtained from remote unsafe.

(cherry picked from commit d62fe154d2)

Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
patchback[bot] 2024-03-25 06:50:08 +01:00 committed by GitHub
parent baa45d044c
commit df95f02c7b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 88 additions and 51 deletions

View file

@ -72,6 +72,7 @@ from ansible.plugins.inventory import (
Cacheable
)
from ansible.utils.display import Display
from ansible.utils.unsafe_proxy import wrap_var as make_unsafe
display = Display()
@ -271,7 +272,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
if not cache or cache_needs_update:
results = self._query()
self._populate(results)
self._populate(make_unsafe(results))
# If the cache has expired/doesn't exist or
# if refresh_inventory/flush cache is used