Changeset 1473 for trunk/packages
- Timestamp:
- Oct 31, 2008, 10:58:23 PM (16 years ago)
- Location:
- trunk/packages/invirt-web
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/invirt-web/code/validation.py
r1318 r1473 5 5 import re 6 6 import string 7 import dns.resolver 7 8 from invirt.database import Machine, NIC, Type, Disk, CDROM, Autoinstall 8 9 from invirt.config import structs as config … … 271 272 if machine is not None and name == machine.name: 272 273 return None 273 if not Machine.query().filter_by(name=name).count(): 274 try: 275 f = open('/tmp/log', 'a') 276 dns.resolver.query('%s.%s.' % (name, config.dns.domains[0]), 'A') 277 # If the hostname didn't exist, it would have thrown an 278 # exception by now - error out 279 raise InvalidInput('name', name, 'Name is already taken.') 280 except dns.resolver.NXDOMAIN, e: 274 281 if not validMachineName(name): 275 282 raise InvalidInput('name', name, 'You must provide a machine name. Max 63 chars, alnum plus \'-\', does not begin or end with \'-\'.') 276 283 return name 277 raise InvalidInput('name', name, "Name is already taken.") 284 except InvalidInput: 285 raise 286 except: 287 # Any other error is a validation failure 288 raise InvalidInput('name', name, 'We were unable to verify that this name is available. If you believe this is in error, please contact us at %s' % config.dns.contact) 278 289 279 290 def testDescription(user, description, machine=None): -
trunk/packages/invirt-web/debian/changelog
r1372 r1473 1 invirt-web (0.0.5) unstable; urgency=low 2 3 * Add new dependency on python-dns 4 5 -- Evan Broder <broder@mit.edu> Fri, 31 Oct 2008 22:57:41 -0400 6 1 7 invirt-web (0.0.4) unstable; urgency=low 2 8 -
trunk/packages/invirt-web/debian/control
r1372 r1473 9 9 Architecture: all 10 10 Depends: ${misc:Depends}, libapache2-mod-fcgid, python-flup, 11 python-cheetah, python-simplejson, invirt-database,11 python-cheetah, python-simplejson, python-dns, invirt-database, 12 12 invirt-vnc-client, kstart, debathena-afs-config, invirt-base, 13 libapache2-svn, libapache2-mod-auth-kerb, postfix, subversion, zephyr-clients 13 libapache2-svn, libapache2-mod-auth-kerb, postfix, subversion, 14 zephyr-clients 14 15 Description: the Invirt web interface
Note: See TracChangeset
for help on using the changeset viewer.