mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 21:00:22 -07:00
sanatize results
This commit is contained in:
parent
92dd563a75
commit
8ce864db6f
3 changed files with 15 additions and 5 deletions
|
@ -69,6 +69,17 @@ def preprocess_vars(a):
|
|||
|
||||
return data
|
||||
|
||||
def strip_internal_keys(dirty):
|
||||
'''
|
||||
All keys stating with _ansible_ are internal, so create a copy of the 'dirty' dict
|
||||
and remove them from the clean one before returning it
|
||||
'''
|
||||
clean = dirty.copy()
|
||||
for k in dirty.keys():
|
||||
if isinstance(k, string_types) and k.startswith('_ansible_'):
|
||||
del clean[k]
|
||||
return clean
|
||||
|
||||
class VariableManager:
|
||||
|
||||
def __init__(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue