help._cp_config['tools.require_login.on'] = False
def parseCreate(self, fields):
- kws = dict([(kw, fields.get(kw)) for kw in
+ kws = dict([(kw, fields[kw]) for kw in
'name description owner memory disksize vmtype cdrom autoinstall'.split()
- if fields.get(kw)])
+ if fields[kw]])
validate = validation.Validate(cherrypy.request.login,
cherrypy.request.state,
strict=True, **kws)
d = getListDict(cherrypy.request.login, cherrypy.request.state)
d['err'] = err
if err:
- for field in fields.keys():
- setattr(d['defaults'], field, fields.get(field))
+ for field, value in fields.items():
+ setattr(d['defaults'], field, value))
else:
d['new_machine'] = parsed_fields['name']
return d
cherrypy.request.state, machine)
info_dict['err'] = err
if err:
- for field in fields.keys():
- setattr(info_dict['defaults'], field, fields.get(field))
+ for field, value in fields.items():
+ setattr(info_dict['defaults'], field, value)
info_dict['result'] = result
return info_dict
olddisk = {}
session.begin()
try:
- kws = dict([(kw, fields.get(kw)) for kw in
+ kws = dict([(kw, fields[kw]) for kw in
'owner admin contact name description memory vmtype disksize'.split()
- if fields.get(kw)])
+ if fields[kw]])
kws['machine_id'] = machine_id
validate = validation.Validate(username, state, **kws)
machine = validate.machine