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 <[email protected]>
---
 lib/cmdlib.py |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/cmdlib.py b/lib/cmdlib.py
index f1a69e6..b153843 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",
-- 
1.6.3.3

Reply via email to