[node-patches] Change in ovirt-node[master]: Make IQN validator abide by RFC3271

rbarry at redhat.com rbarry at redhat.com
Tue Dec 10 17:24:14 UTC 2013


Ryan Barry has uploaded a new change for review.

Change subject: Make IQN validator abide by RFC3271
......................................................................

Make IQN validator abide by RFC3271

Make valid.IQN judiciously follow the RFC

Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1031891

Change-Id: I4bb891377f5238530dc5b2446eb684b05469cc8c
Signed-off-by: Ryan Barry <rbarry at redhat.com>
---
M src/ovirt/node/valid.py
1 file changed, 10 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/70/22270/1

diff --git a/src/ovirt/node/valid.py b/src/ovirt/node/valid.py
index 92ca35f..756efd7 100644
--- a/src/ovirt/node/valid.py
+++ b/src/ovirt/node/valid.py
@@ -473,12 +473,21 @@
 
     >>> IQN()("iqn.1994-05.com.redhat.com:6edea1b458e5")
     True
+    >>> IQN().validate("iqn.2013-10.com~.redhat:123456")
+    False
+    >>> IQN().validate("iqn.2013-10.com!.redhat:123456")
+    False
+    >>> IQN().validate("iqn.2013-10.com#.redhat:123456")
+    False
+    >>> IQN().validate(r'iqn.2013-10.com$%^&*()+_<>?/;"!@.redhat:123456')
+    False
     >>> IQN().validate("")
     False
     """
 
     description = "a valid IQN"
-    pattern = "^iqn\.(\d{4}-\d{2})\.([^:]+):"
+    pattern = "^(?:iqn\.\d{4}-\d{2}(?:\.[A-Za-z](?:[A-Za-z0-9\-]*" + \
+              "[A-Za-z0-9])?)+(?::.*)?$|eui\.[0-9A-Fa-f]{16})"
 
 
 class BlockDevice(Validator):


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

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