[Users] Update request to support "Classless IN-ADDR.ARPA delegation"

Michelle&Judie love.cairn at gmail.com
Tue Jan 28 10:32:03 UTC 2014


Hi guys,

I found a problem on installing server, which has address from small ip
zone, less than a class C.

"engine-setup" checks FQDN resolvability in
"./plugins/ovirt-engine-setup/config/hostname.py".
This program requests forward & reverse query to DNS, and see if it comes
back to host domain name.
But it does not support RFC2317("Classless IN-ADDR.ARPA delegation") type
domain, and fails on FQDN check.

See following URLs for RFC2317 explanation.
http://support.simpledns.com/KB/a146/how-to-sub-delegate-a-reverse-zone.aspx
http://www.rfc-editor.org/rfc/rfc2317.txt

I made patch to "hostname.py" to clear this problem.
Please check following patch, and consider upgrading on the next release.

--- hostname.py.org     2013-12-13 17:22:11.000000000 +0900
+++ hostname.py 2014-01-28 18:01:09.514791351 +0900
@@ -96,15 +96,16 @@
         flags=re.VERBOSE,
         pattern=r"""
             ^
-            (?P<query>\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}).in-addr.arpa.
+            (?P<query>[\w/.-]+)
+            \.
             \s+
             \d+
             \s+
             IN
             \s+
-            PTR
+            (?P<type>(PTR|CNAME))
             \s+
-            (?P<answer>[\w.-]+)
+            (?P<answer>[\w/.-]+)
             \.
             $
         """
@@ -171,11 +172,32 @@
             args=args,
             raiseOnError=False
         )
+        ad=addr.split('.')
+        query="{3}.{2}.{1}.{0}.in-addr.arpa".format(*ad)
         if rc == 0:
             for line in stdout:
                 found = self._DIG_REVLOOKUP_RE.search(line)
-                if found:
-                    names.add(found.group('answer'))
+                if not found:
+                    continue
+                if query != found.group('query'):
+                    continue
+                answer=found.group('answer')
+                if found.group('type') == 'CNAME':
+                    self.logger.debug(
+                        '{query} CNAME to: {answer}'.format(
+                            query=query,
+                            answer=answer,
+                        )
+                    )
+                    query=answer
+                    continue
+                self.logger.debug(
+                    '{query} resolves to: {answer}'.format(
+                        query=query,
+                        answer=answer,
+                    )
+                )
+                names.add(answer)
         return names

     def _validateFQDNresolvability(self, fqdn):

Upgrading to a better patch is greatly appreciated.

Thank you.

Regards,

Mark Kachi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ovirt.org/pipermail/users/attachments/20140128/1f87ccf6/attachment-0001.html>


More information about the Users mailing list