Changeset 1013 for trunk/packages/sipb-xen-www/code/validation.py
- Timestamp:
- Oct 3, 2008, 7:26:43 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/sipb-xen-www/code/validation.py
r1001 r1013 64 64 self.vmtype = validVmType(vmtype) 65 65 if cdrom is not None: 66 if not CDROM. get(cdrom):66 if not CDROM.query().get(cdrom): 67 67 raise CodeError("Invalid cdrom type '%s'" % cdrom) 68 68 self.cdrom = cdrom 69 69 if autoinstall is not None: 70 self.autoinstall = Autoinstall. get(autoinstall)70 self.autoinstall = Autoinstall.query().get(autoinstall) 71 71 72 72 … … 184 184 if vm_type is None: 185 185 return None 186 t = Type. get(vm_type)186 t = Type.query().get(vm_type) 187 187 if t is None: 188 188 raise CodeError("Invalid vm type '%s'" % vm_type) … … 201 201 except ValueError: 202 202 raise InvalidInput('machine_id', machine_id, "Must be an integer.") 203 machine = Machine. get(machine_id)203 machine = Machine.query().get(machine_id) 204 204 if exists and machine is None: 205 205 raise InvalidInput('machine_id', machine_id, "Does not exist.") … … 271 271 if machine is not None and name == machine.name: 272 272 return None 273 if not Machine.query().filter_by(name=name) :273 if not Machine.query().filter_by(name=name).count(): 274 274 if not validMachineName(name): 275 275 raise InvalidInput('name', name, 'You must provide a machine name. Max 63 chars, alnum plus \'-\', does not begin or end with \'-\'.')
Note: See TracChangeset
for help on using the changeset viewer.