[node-patches] Change in ovirt-node[master]: valid.FQDN should allow more cases

rbarry at redhat.com rbarry at redhat.com
Mon Jul 8 21:37:23 UTC 2013


Ryan Barry has uploaded a new change for review.

Change subject: valid.FQDN should allow more cases
......................................................................

valid.FQDN should allow more cases

Previously, valid.FQDN rejected hostnames which are otherwise
allowed. Make sure that we allow hostnames which end with a raw
dot, have levels comprised of nothing but numbers, and other
edge cases.

For the time being, disallow entries which look like
IP addresses (\d+.\d+.\d+.\d+), but allow other variations on that
theme (RFC1123 technically allows this, and specifies that IP
addresses should be tried first with DNS second for the [surprisingly
valid] IPv4-identical FQDNs though RFC1738 implies that TLDs in URLs
will never start with a digit.

Change-Id: Iacbd4b5358143c0f1be5ed263ad2393283540d33
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=981614
Signed-off-by: Ryan Barry <rbarry at redhat.com>
---
M src/ovirt/node/valid.py
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/92/16592/1

diff --git a/src/ovirt/node/valid.py b/src/ovirt/node/valid.py
index 8d47e80..eac7e47 100644
--- a/src/ovirt/node/valid.py
+++ b/src/ovirt/node/valid.py
@@ -277,8 +277,8 @@
     """
 
     description = "a valid FQDN"
-    pattern = ("^(([0-9]\.)?([a-z]|[a-z][a-z0-9\-]*[a-z0-9])\.)*" +
-               "([a-z]|[a-z][a-z0-9\-]*[a-z0-9])$", re.I)
+    pattern = ("^(?!(\d+\.){3}\d+)(([a-z0-9\-]*[a-z0-9])\.)*" +
+               "(([a-z0-9\-]*[a-z0-9])\.?)$", re.I)
 
     def validate(self, value):
         is_valid = super(FQDN, self).validate(value)


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

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