MH - dicts and lists change-tracking is fixed (#2951) (#2952)

* dicts and lists change-tracking is fixed

* added changelog fragment

* fixed sanity check

(cherry picked from commit 56acd4356f)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
patchback[bot] 2021-07-08 07:52:51 +02:00 committed by GitHub
parent 1b5d91153b
commit 5f971e677a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 34 additions and 2 deletions

View file

@ -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