[node-patches] Change in ovirt-node[master]: valid: Add boolean

fabiand at fedoraproject.org fabiand at fedoraproject.org
Tue Dec 11 20:09:41 UTC 2012


Fabian Deutsch has uploaded a new change for review.

Change subject: valid: Add boolean
......................................................................

valid: Add boolean

Change-Id: I6b8a374f812dc04326dd923c1b90adc486186139
Signed-off-by: Fabian Deutsch <fabiand at fedoraproject.org>
---
M scripts/tui/src/ovirt/node/valid.py
1 file changed, 11 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/49/9949/1

diff --git a/scripts/tui/src/ovirt/node/valid.py b/scripts/tui/src/ovirt/node/valid.py
index af00158..0620faa 100644
--- a/scripts/tui/src/ovirt/node/valid.py
+++ b/scripts/tui/src/ovirt/node/valid.py
@@ -97,6 +97,10 @@
             self.pattern = (self.pattern, )
         if type(value) in [bool, int]:
             value = str(value)
+        elif type(value) in [str, unicode]:
+            pass
+        else:
+            self.logger.warning("Unknown type: %s %s" % (value, type(value)))
         return re.compile(*self.pattern).search(value) != None
 
 
@@ -334,3 +338,10 @@
         if self.requires_path:
             is_valid &= p.path != ""
         return is_valid
+
+
+class Boolean(Validator):
+    description = "a valid boolean (True or False)"
+
+    def validate(self, value):
+        return value in [True, False]


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6b8a374f812dc04326dd923c1b90adc486186139
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Fabian Deutsch <fabiand at fedoraproject.org>



More information about the node-patches mailing list