[node-patches] Change in ovirt-node[master]: Add trigger_valid to plugins

rbarry at redhat.com rbarry at redhat.com
Thu May 1 20:55:05 UTC 2014


Ryan Barry has uploaded a new change for review.

Change subject: Add trigger_valid to plugins
......................................................................

Add trigger_valid to plugins

Re-add the ability to trigger the validity of fields. Add a
convenience function to drop invalid changes from a field, and
one which triggers invalidity on fields which have not yet had
entry.

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


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/14/27314/1

diff --git a/src/ovirt/node/plugins.py b/src/ovirt/node/plugins.py
index cb8ae6f..fea02e2 100644
--- a/src/ovirt/node/plugins.py
+++ b/src/ovirt/node/plugins.py
@@ -211,6 +211,17 @@
             self.__changes = Changeset()
         return is_valid
 
+    def trigger_valid(self, path, valid=True):
+        if path in self.__changes:
+            self.__changes.drop([path])
+        else:
+            self.__invalid_changes.drop([path])
+            self._on_ui_change({})
+
+    def trigger_invalid(self):
+        if not path in self.__changes or path in self.__invalid_changes:
+            self._on_ui_change({path: None})
+
     def __validate(self, changes):
         """Test changes against the validators
 


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9f82eb54564e8037b74b82817b0e864655400d02
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