From 03e5cdd533be3538cbab73b40899aaf4939b2b39 Mon Sep 17 00:00:00 2001 From: Agata Murawska Date: Mon, 9 Jul 2012 11:00:53 +0200 Subject: [PATCH] Ignore offline node errors when removing disks MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit When we delete DRBD disks from some instance, we do not want to get errors due to nodes other than that instance's primary being offline. Signed-off-by: Agata Murawska Reviewed-by: Iustin Pop Reviewed-by: René Nussbaumer --- lib/cmdlib.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/cmdlib.py b/lib/cmdlib.py index dde940d..a1d6754 100644 --- a/lib/cmdlib.py +++ b/lib/cmdlib.py @@ -9015,11 +9015,12 @@ def _RemoveDisks(lu, instance, target_node=None, ignore_failures=False): edata = device.ComputeNodeTree(instance.primary_node) for node, disk in edata: lu.cfg.SetDiskID(disk, node) - msg = lu.rpc.call_blockdev_remove(node, disk).fail_msg - if msg: + result = lu.rpc.call_blockdev_remove(node, disk) + if result.fail_msg: lu.LogWarning("Could not remove disk %s on node %s," - " continuing anyway: %s", idx, node, msg) - all_result = False + " continuing anyway: %s", idx, node, result.fail_msg) + if not (result.offline and node != instance.primary_node): + all_result = False # if this is a DRBD disk, return its port to the pool if device.dev_type in constants.LDS_DRBD: -- 1.7.10.4