Changeset 2526 for package_branches/invirt-web/cherrypy/code/main.py
- Timestamp:
- Oct 29, 2009, 1:36:42 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
package_branches/invirt-web/cherrypy/code/main.py
r2525 r2526 205 205 206 206 def parseCreate(self, fields): 207 kws = dict([(kw, fields .get(kw)) for kw in207 kws = dict([(kw, fields[kw]) for kw in 208 208 'name description owner memory disksize vmtype cdrom autoinstall'.split() 209 if fields .get(kw)])209 if fields[kw]]) 210 210 validate = validation.Validate(cherrypy.request.login, 211 211 cherrypy.request.state, … … 235 235 d['err'] = err 236 236 if err: 237 for field in fields.keys():238 setattr(d['defaults'], field, fields.get(field))237 for field, value in fields.items(): 238 setattr(d['defaults'], field, value)) 239 239 else: 240 240 d['new_machine'] = parsed_fields['name'] … … 300 300 info_dict['err'] = err 301 301 if err: 302 for field in fields.keys():303 setattr(info_dict['defaults'], field, fields.get(field))302 for field, value in fields.items(): 303 setattr(info_dict['defaults'], field, value) 304 304 info_dict['result'] = result 305 305 return info_dict … … 582 582 session.begin() 583 583 try: 584 kws = dict([(kw, fields .get(kw)) for kw in584 kws = dict([(kw, fields[kw]) for kw in 585 585 'owner admin contact name description memory vmtype disksize'.split() 586 if fields .get(kw)])586 if fields[kw]]) 587 587 kws['machine_id'] = machine_id 588 588 validate = validation.Validate(username, state, **kws)
Note: See TracChangeset
for help on using the changeset viewer.