import sipb_xen_database
from sipb_xen_database import Machine, CDROM, ctx, connect, MachineAccess, Type, Autoinstall
import validation
+import cache_acls
from webcommon import InvalidInput, CodeError, g
import controls
disk.size = disksize
ctx.current.save(disk)
- if owner is not None:
+ update_acl = False
+ if owner is not None and owner != machine.owner:
machine.owner = owner
+ update_acl = True
if name is not None:
machine.name = name
- if admin is not None:
+ if admin is not None and admin != machine.administrator:
machine.administrator = admin
+ update_acl = True
if contact is not None:
machine.contact = contact
ctx.current.save(machine)
+ if update_acl:
+ cache_acls.refreshMachine(machine)
transaction.commit()
except:
transaction.rollback()