mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00:00
Validate new blocks during copy
It is possible that a block is copied prior to validation, in which case some fields (like when) which should be something other than a string might not be. Using validate() in copy() is relatively harmless and ensures the blocks are in the proper structure. This also cleans up some of the finalized logic from an earlier commit and adds similar logic for validated. Fixes #17018
This commit is contained in:
@@ -192,6 +192,7 @@ class Block(Base, Become, Conditional, Taggable):
|
||||
if self._role:
|
||||
new_me._role = self._role
|
||||
|
||||
new_me.validate()
|
||||
return new_me
|
||||
|
||||
def serialize(self):
|
||||
|
||||
Reference in New Issue
Block a user