mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-30 14:21:26 -07:00
Do not use mutable defaults in FieldAttribute, instead allow supplying a callable for defaults of mutable types. Fixes #46824 (#46833)
This commit is contained in:
parent
0dd17b521f
commit
a06a5ded61
14 changed files with 57 additions and 37 deletions
|
@ -70,22 +70,22 @@ class Task(Base, Conditional, Taggable, Become):
|
|||
# inheritance is only triggered if the 'current value' is None,
|
||||
# default can be set at play/top level object and inheritance will take it's course.
|
||||
|
||||
_args = FieldAttribute(isa='dict', default=dict())
|
||||
_args = FieldAttribute(isa='dict', default=dict)
|
||||
_action = FieldAttribute(isa='string')
|
||||
|
||||
_async_val = FieldAttribute(isa='int', default=0, alias='async')
|
||||
_changed_when = FieldAttribute(isa='list', default=[])
|
||||
_changed_when = FieldAttribute(isa='list', default=list)
|
||||
_delay = FieldAttribute(isa='int', default=5)
|
||||
_delegate_to = FieldAttribute(isa='string')
|
||||
_delegate_facts = FieldAttribute(isa='bool')
|
||||
_failed_when = FieldAttribute(isa='list', default=[])
|
||||
_failed_when = FieldAttribute(isa='list', default=list)
|
||||
_loop = FieldAttribute()
|
||||
_loop_control = FieldAttribute(isa='class', class_type=LoopControl, inherit=False)
|
||||
_notify = FieldAttribute(isa='list')
|
||||
_poll = FieldAttribute(isa='int', default=10)
|
||||
_register = FieldAttribute(isa='string')
|
||||
_retries = FieldAttribute(isa='int', default=3)
|
||||
_until = FieldAttribute(isa='list', default=[])
|
||||
_until = FieldAttribute(isa='list', default=list)
|
||||
|
||||
# deprecated, used to be loop and loop_args but loop has been repurposed
|
||||
_loop_with = FieldAttribute(isa='string', private=True, inherit=False)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue