machine)
name = testName(user, fields.getfirst('name'), machine)
oldname = machine.name
+ command="modify"
olddisk = {}
memory = fields.getfirst('memory')
disksize = testDisk(user, fields.getfirst('disk'))
if disksize is not None:
disksize = validDisk(user, disksize, machine)
+ else:
+ disksize = machine.disks[0].size
for disk in machine.disks:
- disk.size = disksize
olddisk[disk.guest_device_name] = disk.size
+ disk.size = disksize
ctx.current.save(disk)
# XXX all NICs get same hostname on change? Interface doesn't support more.
if oldname != name:
remctl("web", "lvrename", oldname, disk.guest_device_name, name)
d = dict(user=user,
- command="modify",
+ command=command,
machine=machine)
return Template(file="command.tmpl", searchList=[d, global_dict])