avoid persistent containers in attribute defaults

moved from the field attribute declaration and created a placeholder
which then is resolved in the field attribute class.

this is to avoid unwanted persistent of the defaults across objects which introduces
stealth bugs when multiple objects of the same kind are used in succession while
not overriding the default values.
This commit is contained in:
Brian Coca 2015-12-09 07:21:00 -08:00
commit 87969868d4
9 changed files with 29 additions and 18 deletions

View file

@ -64,7 +64,7 @@ class Task(Base, Conditional, Taggable, Become):
# will be used if defined
# might be possible to define others
_args = FieldAttribute(isa='dict', default=dict())
_args = FieldAttribute(isa='dict', default='_ansible_container')
_action = FieldAttribute(isa='string')
_any_errors_fatal = FieldAttribute(isa='bool')