Changeset 3027 for trunk/packages/invirt-web/code/main.py
- Timestamp:
- Jun 26, 2010, 8:33:53 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/invirt-web/code/main.py
r2979 r3027 538 538 machine.type = validate.vmtype 539 539 540 update_acl = False 541 if hasattr(validate, 'owner') and validate.owner != machine.owner: 542 machine.owner = validate.owner 543 update_acl = True 544 if hasattr(validate, 'description'): 545 machine.description = validate.description 546 if hasattr(validate, 'admin') and validate.admin != machine.administrator: 547 machine.administrator = validate.admin 548 update_acl = True 549 if hasattr(validate, 'contact'): 550 machine.contact = validate.contact 551 552 session.save_or_update(machine) 553 session.commit() 554 except: 555 session.rollback() 556 raise 557 558 session.begin() 559 try: 540 560 if hasattr(validate, 'disksize'): 541 561 disksize = validate.disksize … … 545 565 disk.size = disksize 546 566 session.save_or_update(disk) 547 548 update_acl = False 549 if hasattr(validate, 'owner') and validate.owner != machine.owner: 550 machine.owner = validate.owner 551 update_acl = True 567 for diskname in olddisk: 568 controls.resizeDisk(oldname, diskname, str(olddisk[diskname])) 569 session.save_or_update(machine) 570 session.commit() 571 except: 572 session.rollback() 573 raise 574 575 session.begin() 576 try: 552 577 if hasattr(validate, 'name'): 553 578 machine.name = validate.name … … 555 580 if n.hostname == oldname: 556 581 n.hostname = validate.name 557 if hasattr(validate, 'description'): 558 machine.description = validate.description 559 if hasattr(validate, 'admin') and validate.admin != machine.administrator: 560 machine.administrator = validate.admin 561 update_acl = True 562 if hasattr(validate, 'contact'): 563 machine.contact = validate.contact 564 582 if hasattr(validate, 'name'): 583 controls.renameMachine(machine, oldname, validate.name) 565 584 session.save_or_update(machine) 566 if update_acl:567 cache_acls.refreshMachine(machine)568 585 session.commit() 569 586 except: 570 587 session.rollback() 571 588 raise 572 for diskname in olddisk: 573 controls.resizeDisk(oldname, diskname, str(olddisk[diskname]))574 if hasattr(validate, 'name'):575 controls.renameMachine(machine, oldname, validate.name) 589 590 if update_acl: 591 cache_acls.refreshMachine(machine) 592 576 593 return dict(machine=machine) 577 594
Note: See TracChangeset
for help on using the changeset viewer.