fix for filter fix

This commit is contained in:
Brian Coca 2016-11-17 13:41:57 -05:00
parent 7c960d440f
commit 5d043b65d3

View file

@ -672,7 +672,7 @@ class ActionBase(with_metaclass(ABCMeta, object)):
data = json.loads(filtered_output) data = json.loads(filtered_output)
data['_ansible_parsed'] = True data['_ansible_parsed'] = True
if 'ansible_facts' in data and isinstance(data['ansible_facts'], dict): if 'ansible_facts' in data and isinstance(data['ansible_facts'], dict):
remove_keys = set(['ansible_rsync_path']) remove_keys = set()
fact_keys = set(data['ansible_facts'].keys()) fact_keys = set(data['ansible_facts'].keys())
# first we add all of our magic variable names to the set of # first we add all of our magic variable names to the set of
# keys we want to remove from facts # keys we want to remove from facts
@ -688,6 +688,12 @@ class ActionBase(with_metaclass(ABCMeta, object)):
remove_keys.add(fact_key) remove_keys.add(fact_key)
except AttributeError: except AttributeError:
pass pass
# remove some KNOWN keys
for hard in ['ansible_rsync_path']:
if hard in fact_keys:
remove_keys.add(hard)
# finally, we search for interpreter keys to remove # finally, we search for interpreter keys to remove
re_interp = re.compile('^ansible_.*_interpreter$') re_interp = re.compile('^ansible_.*_interpreter$')
for fact_key in fact_keys: for fact_key in fact_keys: