Simone Tiraboschi has uploaded a new change for review.

Change subject: core: making parseTypedValue more severe
......................................................................

core: making parseTypedValue more severe

Raising a runtime execption if it finds a key with none type
but an inappropriate value. It can help the user to
point it some kind of problems with its edeited answerfile

Change-Id: I356b0d8029d9785bff54744614ed1e679c32529c
Bug-Url: https://bugzilla.redhat.com/1146234
Signed-off-by: Simone Tiraboschi <[email protected]>
---
M src/otopi/common.py
1 file changed, 6 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/otopi refs/changes/70/33370/1

diff --git a/src/otopi/common.py b/src/otopi/common.py
index 4eee430..5fb9694 100644
--- a/src/otopi/common.py
+++ b/src/otopi/common.py
@@ -39,6 +39,12 @@
         raise ValueError(_("Missing variable type"))
 
     if vtype == constants.Types.NONE:
+        if value not in ('', 'none', 'None'):
+            raise ValueError(
+                _("Inappropriate value for none type '{value}'").format(
+                    value=value
+                )
+            )
         value = None
     elif vtype == constants.Types.BOOLEAN:
         value = value not in (0, 'f', 'F', 'false', 'False')


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I356b0d8029d9785bff54744614ed1e679c32529c
Gerrit-PatchSet: 1
Gerrit-Project: otopi
Gerrit-Branch: master
Gerrit-Owner: Simone Tiraboschi <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to