mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-02 20:24:23 -07:00
Don't use copy.deepcopy in high workload areas, use naive_deepcopy (#44337)
* Don't use copy.deepcopy in high workload areas, use deepishcopy. ci_complete * Add tests * Add changelog fragment * rename to naive_deepcopy and add extra docs * Rename to module_response_deepcopy and move to vars/clean
This commit is contained in:
parent
27ac2fc67c
commit
9b2baebe64
6 changed files with 119 additions and 11 deletions
|
@ -5,11 +5,9 @@
|
|||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
from copy import deepcopy
|
||||
|
||||
from ansible import constants as C
|
||||
from ansible.parsing.dataloader import DataLoader
|
||||
from ansible.vars.clean import strip_internal_keys
|
||||
from ansible.vars.clean import module_response_deepcopy, strip_internal_keys
|
||||
|
||||
_IGNORE = ('failed', 'skipped')
|
||||
_PRESERVE = ('attempts', 'changed', 'retries')
|
||||
|
@ -131,7 +129,7 @@ class TaskResult:
|
|||
|
||||
result._result = x
|
||||
elif self._result:
|
||||
result._result = deepcopy(self._result)
|
||||
result._result = module_response_deepcopy(self._result)
|
||||
|
||||
# actualy remove
|
||||
for remove_key in ignore:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue