mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-28 21:31: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
|
@ -32,9 +32,9 @@ from ansible.playbook.taggable import Taggable
|
|||
class Block(Base, Become, Conditional, Taggable):
|
||||
|
||||
# main block fields containing the task lists
|
||||
_block = FieldAttribute(isa='list', default=[], inherit=False)
|
||||
_rescue = FieldAttribute(isa='list', default=[], inherit=False)
|
||||
_always = FieldAttribute(isa='list', default=[], inherit=False)
|
||||
_block = FieldAttribute(isa='list', default=list, inherit=False)
|
||||
_rescue = FieldAttribute(isa='list', default=list, inherit=False)
|
||||
_always = FieldAttribute(isa='list', default=list, inherit=False)
|
||||
|
||||
# other fields
|
||||
_delegate_to = FieldAttribute(isa='string')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue