Ignore:
Timestamp:
Jun 2, 2008, 11:58:25 PM (16 years ago)
Author:
ecprice
Message:

Fix more bugs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/sipb-xen-www/code/validation.py

    r576 r577  
    2020    def __init__(self, username, state, machine_id=None, name=None, owner=None,
    2121                 admin=None, contact=None, memory=None, disksize=None,
    22                  vmtype=None, cdrom=None, clone_from=None):
     22                 vmtype=None, cdrom=None, clone_from=None, strict=False):
    2323        # XXX Successive quota checks aren't a good idea, since you
    2424        # can't necessarily change the locker and disk size at the
    2525        # same time.
    2626        created_new = (machine_id is None)
     27
     28        if strict:
     29            if name is None:
     30                raise InvalidInput('name', name, "You must provide a machine name.")
     31            if memory is None:
     32                raise InvalidInput('memory', memory, "You must provide a memory size.")
     33            if disksize is None:
     34                raise InvalidInput('disk', disksize, "You must provide a disk size.")
    2735
    2836        if machine_id is not None:
Note: See TracChangeset for help on using the changeset viewer.