Skip to content

Commit

Permalink
Don't modify the original task ds when preprocessing data
Browse files Browse the repository at this point in the history
In the case of using YAML anchors/aliases, YAML actually uses references
to the duplicated object so any modifications to the original impacts
later uses of the object.

Fixes ansible#13575
  • Loading branch information
jimi-c committed Jun 28, 2016
1 parent 394430a commit af249b8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ansible/playbook/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def preprocess_data(self, ds):
if 'vars' in ds:
# _load_vars is defined in Base, and is used to load a dictionary
# or list of dictionaries in a standard way
new_ds['vars'] = self._load_vars(None, ds.pop('vars'))
new_ds['vars'] = self._load_vars(None, ds.get('vars'))
else:
new_ds['vars'] = dict()

Expand Down

0 comments on commit af249b8

Please sign in to comment.