瀏覽代碼

QubesVm: setter hook passes old value

This is part of #827 bug.
Wojciech Zygmunt Porczyk 10 年之前
父節點
當前提交
a63a8069b1
共有 1 個文件被更改,包括 4 次插入3 次删除
  1. 4 3
      core-modules/000QubesVm.py

+ 4 - 3
core-modules/000QubesVm.py

@@ -219,9 +219,9 @@ class QubesVm(object):
             attrs = hook(self, attrs)
         return attrs
 
-    def post_set_attr(self, attr, value):
+    def post_set_attr(self, attr, newvalue, oldvalue):
         for hook in self.hooks_set_attr:
-            hook(self, attr, value)
+            hook(self, attr, newvalue, oldvalue)
 
     def __basic_parse_xml_attr(self, value):
         if value is None:
@@ -523,8 +523,9 @@ class QubesVm(object):
 
     @internal.setter
     def internal(self, value):
+        oldvalue = self._internal
         self._internal = value
-        self.post_set_attr('internal', value)
+        self.post_set_attr('internal', value, oldvalue)
 
     @property
     def autostart(self):