From dfc2a24c1858c6845ebf6bd2fb63b7ac4816fe9c Mon Sep 17 00:00:00 2001 From: Guido Trotter <ultrotter@google.com> Date: Mon, 21 Sep 2009 15:11:25 +0100 Subject: [PATCH] Fix _RemoveDisk for file based instances During 621b7678 two typos were introduced which prevent file based instances removal to work correctly. Fixing both of them to what they were meant to be. Signed-off-by: Guido Trotter <ultrotter@google.com> Reviewed-by: Iustin Pop <iustin@google.com> --- lib/cmdlib.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/cmdlib.py b/lib/cmdlib.py index f1a69e6b7..b15384358 100644 --- a/lib/cmdlib.py +++ b/lib/cmdlib.py @@ -5258,10 +5258,10 @@ def _RemoveDisks(lu, instance, target_node=None): if instance.disk_template == constants.DT_FILE: file_storage_dir = os.path.dirname(instance.disks[0].logical_id[1]) - if target_node is node: - tgt = instance.primary_node + if target_node: + tgt = target_node else: - tgt = instance.target_node + tgt = instance.primary_node result = lu.rpc.call_file_storage_dir_remove(tgt, file_storage_dir) if result.fail_msg: lu.LogWarning("Could not remove directory '%s' on node %s: %s", -- GitLab