Changeset 1542


Ignore:
Timestamp:
Nov 6, 2008, 9:52:39 PM (16 years ago)
Author:
broder
Message:

In the web interface, validate names by querying against the local
nameserver

This fixes the case where the default nameserver is caching an old
value.

Location:
trunk/packages/invirt-web
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/invirt-web/code/validation.py

    r1495 r1542  
    274274    try:
    275275        hostname = '%s.%s.' % (name, config.dns.domains[0])
     276        resolver = dns.resolver.Resolver()
     277        resolver.nameservers = ['127.0.0.1']
    276278        try:
    277             dns.resolver.query(hostname, 'A')
     279            resolver.query(hostname, 'A')
    278280        except dns.resolver.NoAnswer, e:
    279281            # If we can get the TXT record, then we can verify it's
    280282            # reserved. If this lookup fails, let it bubble up and be
    281283            # dealt with
    282             answer = dns.resolver.query(hostname, 'TXT')
     284            answer = resolver.query(hostname, 'TXT')
    283285            txt = answer[0].strings[0]
    284286            if txt.startswith('reserved'):
  • trunk/packages/invirt-web/debian/changelog

    r1514 r1542  
     1invirt-web (0.0.7) unstable; urgency=low
     2
     3  * Query against the local nameserver to be sure there's no caching of
     4    deleted hosts
     5
     6 -- Evan Broder <broder@mit.edu>  Thu, 06 Nov 2008 21:44:27 -0500
     7
    18invirt-web (0.0.6) unstable; urgency=low
    29
Note: See TracChangeset for help on using the changeset viewer.