Fix fact cleaning (#42595)

* fix fact cleanup

fixes #41684
This commit is contained in:
Brian Coca 2018-07-12 16:12:42 -04:00 committed by GitHub
commit 006f08da99
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 7 deletions

View file

@ -43,7 +43,7 @@ from ansible.template import Templar
from ansible.utils.listify import listify_lookup_plugin_terms
from ansible.utils.vars import combine_vars
from ansible.utils.unsafe_proxy import wrap_var
from ansible.vars.clean import namespace_facts
from ansible.vars.clean import namespace_facts, clean_facts
try:
from __main__ import display
@ -313,7 +313,7 @@ class VariableManager:
# push facts to main namespace
if C.INJECT_FACTS_AS_VARS:
all_vars = combine_vars(all_vars, wrap_var(facts))
all_vars = combine_vars(all_vars, wrap_var(clean_facts(facts)))
else:
# always 'promote' ansible_local
all_vars = combine_vars(all_vars, wrap_var({'ansible_local': facts.get('ansible_local', {})}))