[node-patches] Change in ovirt-node[master]: Be smarter about stashing changes for validation

rbarry at redhat.com rbarry at redhat.com
Wed Aug 13 15:51:05 UTC 2014


Ryan Barry has uploaded a new change for review.

Change subject: Be smarter about stashing changes for validation
......................................................................

Be smarter about stashing changes for validation

Don't save empty parts of the model, that way they won't be
reused if we repopulate fields. This still allows for flagging
fields as long as we don't use reuse_old, but lets us swap the
page without flagging untouched fields if necessary

Change-Id: I344ffba11cc27c5e325e91bc50727d0a7e734732
Signed-off-by: Ryan Barry <rbarry at redhat.com>
---
M src/ovirt/node/plugins.py
1 file changed, 4 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/72/31472/1

diff --git a/src/ovirt/node/plugins.py b/src/ovirt/node/plugins.py
index 022a916..a66a1d4 100644
--- a/src/ovirt/node/plugins.py
+++ b/src/ovirt/node/plugins.py
@@ -221,7 +221,7 @@
             path: the widget path
         """
 
-        if path in self.__changes:
+        if path in self.__changes and self.__changes[path]:
             self.__stashed_changes.update({path: self.__changes[path]})
             self.__changes.drop([path])
             self.widgets[path].notice("")
@@ -247,8 +247,9 @@
             value = self.__changes[path] if path in self.__changes else \
                 self.__invalid_changes[path]
             self._on_ui_change({path: value})
-        elif path in self.__stashed_changes and reuse_old:
-            self._on_ui_change({path: self.__stashed_changes[path]})
+        elif reuse_old:
+            if path in self.__stashed_changes:
+                self._on_ui_change({path: self.__stashed_changes[path]})
         else:
             self._on_ui_change({path: ""})
 


-- 
To view, visit http://gerrit.ovirt.org/31472
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I344ffba11cc27c5e325e91bc50727d0a7e734732
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Ryan Barry <rbarry at redhat.com>



More information about the node-patches mailing list