- Timestamp:
- Dec 20, 2009, 9:46:43 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
package_branches/invirt-web/cherrypy-rebased/code/main.py
r2706 r2707 200 200 201 201 def parseCreate(self, fields): 202 kws = dict([(kw, fields .get(kw)) for kw in202 kws = dict([(kw, fields[kw]) for kw in 203 203 'name description owner memory disksize vmtype cdrom autoinstall'.split() 204 if fields .get(kw)])204 if fields[kw]]) 205 205 validate = validation.Validate(cherrypy.request.login, 206 206 cherrypy.request.state, … … 230 230 d['err'] = err 231 231 if err: 232 for field in fields.keys():233 setattr(d['defaults'], field, fields.get(field))232 for field, value in fields.items(): 233 setattr(d['defaults'], field, value)) 234 234 else: 235 235 d['new_machine'] = parsed_fields['name'] … … 295 295 info_dict['err'] = err 296 296 if err: 297 for field in fields.keys():298 setattr(info_dict['defaults'], field, fields.get(field))297 for field, value in fields.items(): 298 setattr(info_dict['defaults'], field, value) 299 299 info_dict['result'] = result 300 300 return info_dict … … 528 528 session.begin() 529 529 try: 530 kws = dict([(kw, fields .get(kw)) for kw in530 kws = dict([(kw, fields[kw]) for kw in 531 531 'owner admin contact name description memory vmtype disksize'.split() 532 if fields .get(kw)])532 if fields[kw]]) 533 533 kws['machine_id'] = machine_id 534 534 validate = validation.Validate(username, state, **kws)
Note: See TracChangeset
for help on using the changeset viewer.