mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
MH - dicts and lists change-tracking is fixed (#2951)
* dicts and lists change-tracking is fixed * added changelog fragment * fixed sanity check
This commit is contained in:
parent
c0740ca398
commit
56acd4356f
3 changed files with 34 additions and 2 deletions
|
@ -6,6 +6,8 @@
|
|||
from __future__ import absolute_import, division, print_function
|
||||
__metaclass__ = type
|
||||
|
||||
import copy
|
||||
|
||||
|
||||
class VarMeta(object):
|
||||
NOTHING = object()
|
||||
|
@ -30,11 +32,11 @@ class VarMeta(object):
|
|||
if fact is not None:
|
||||
self.fact = fact
|
||||
if initial_value is not self.NOTHING:
|
||||
self.initial_value = initial_value
|
||||
self.initial_value = copy.deepcopy(initial_value)
|
||||
|
||||
def set_value(self, value):
|
||||
if not self.init:
|
||||
self.initial_value = value
|
||||
self.initial_value = copy.deepcopy(value)
|
||||
self.init = True
|
||||
self.value = value
|
||||
return self
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue