Patch has been pushed to stable-2.15 @ 48d11548319cfebf5f701c35d02a4d79c0f51bb1
On 31 January 2017 at 10:40, Federico Pareschi <[email protected]> wrote: > Hey Yannis. Patch looks good, thanks for submitting this, I'll be > pushing it to 2.15. > > On 26 January 2017 at 21:03, Yiannis Tsiouris <[email protected]> wrote: >> Before this patch, the warning of RemoveDisks was incorrectly showing >> the index of the disk (whose removal failed) in the list of the >> "pending-removal" disks instead of the, more general, instance's disk >> list. >> >> Signed-off-by: Yiannis Tsiouris <[email protected]> >> Signed-off-by: Ivan Kanakarakis <[email protected]> >> --- >> lib/cmdlib/instance_utils.py | 7 ++++++- >> 1 file changed, 6 insertions(+), 1 deletion(-) >> >> diff --git a/lib/cmdlib/instance_utils.py b/lib/cmdlib/instance_utils.py >> index 46cf28db7..059c43a46 100644 >> --- a/lib/cmdlib/instance_utils.py >> +++ b/lib/cmdlib/instance_utils.py >> @@ -335,6 +335,11 @@ def RemoveDisks(lu, instance, disks=None, >> disks = all_disks >> >> anno_disks = AnnotateDiskParams(instance, disks, lu.cfg) >> + >> + uuid_idx_map = {} >> + for (idx, device) in enumerate(all_disks): >> + uuid_idx_map[device.uuid] = idx >> + >> for (idx, device) in enumerate(anno_disks): >> if target_node_uuid: >> edata = [(target_node_uuid, device)] >> @@ -344,7 +349,7 @@ def RemoveDisks(lu, instance, disks=None, >> result = lu.rpc.call_blockdev_remove(node_uuid, (disk, instance)) >> if result.fail_msg: >> lu.LogWarning("Could not remove disk %s on node %s," >> - " continuing anyway: %s", idx, >> + " continuing anyway: %s", >> uuid_idx_map.get(device.uuid), >> lu.cfg.GetNodeName(node_uuid), result.fail_msg) >> if not (result.offline and node_uuid != instance.primary_node): >> all_result = False >> -- >> 2.11.0 >>
