Commit 853c570b authored by Helga Velroyen's avatar Helga Velroyen
Browse files

Fixing crash when removing disks



This bug was introduced by my commit "Check ispecs against ipolicy on
instance modify", because I did not filter for the 'add' action. Thus it
would try to read the size parameter also when removing disks.
Signed-off-by: default avatarHelga Velroyen <helgav@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 48aaca91
......@@ -13288,7 +13288,7 @@ class LUInstanceSetParams(LogicalUnit):
errors.ECODE_STATE)
disk_sizes = [disk.size for disk in instance.disks]
disk_sizes.extend(params["size"] for (op, idx, params, private) in
self.diskmod)
self.diskmod if op == constants.DDM_ADD)
ispec[constants.ISPEC_DISK_COUNT] = len(disk_sizes)
ispec[constants.ISPEC_DISK_SIZE] = disk_sizes
 
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment