mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-02 14:40:19 -07:00
Namespaced facts fixes (#26615)
* shorten warning on reservd fact collision also remove ansible_ from namespaced facts for vars manager handle str conversion errors use tuple to avoid iterator errors version added added * only modify final one * removed ansible_ removal
This commit is contained in:
parent
f51d607f25
commit
a5007f2f88
4 changed files with 25 additions and 18 deletions
|
@ -812,7 +812,13 @@ class ActionBase(with_metaclass(ABCMeta, object)):
|
|||
# then we remove them (except for ssh host keys)
|
||||
for r_key in remove_keys:
|
||||
if not r_key.startswith('ansible_ssh_host_key_'):
|
||||
display.warning("Removed restricted key from module data: %s = %s" % (r_key, data[r_key]))
|
||||
try:
|
||||
r_val = to_text(data[r_key])
|
||||
if len(r_val) > 24:
|
||||
r_val = '%s ... %s' % (r_val[:13], r_val[-6:])
|
||||
except:
|
||||
r_val = ' <failed to convert value to a string> '
|
||||
display.warning("Removed restricted key from module data: %s = %s" % (r_key, r_val))
|
||||
del data[r_key]
|
||||
|
||||
self._remove_internal_keys(data)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue