Commit dfc2a24c authored by Guido Trotter's avatar Guido Trotter

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: default avatarGuido Trotter <ultrotter@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent a5b360e4
...@@ -5258,10 +5258,10 @@ def _RemoveDisks(lu, instance, target_node=None): ...@@ -5258,10 +5258,10 @@ def _RemoveDisks(lu, instance, target_node=None):
if instance.disk_template == constants.DT_FILE: if instance.disk_template == constants.DT_FILE:
file_storage_dir = os.path.dirname(instance.disks[0].logical_id[1]) file_storage_dir = os.path.dirname(instance.disks[0].logical_id[1])
if target_node is node: if target_node:
tgt = instance.primary_node tgt = target_node
else: else:
tgt = instance.target_node tgt = instance.primary_node
result = lu.rpc.call_file_storage_dir_remove(tgt, file_storage_dir) result = lu.rpc.call_file_storage_dir_remove(tgt, file_storage_dir)
if result.fail_msg: if result.fail_msg:
lu.LogWarning("Could not remove directory '%s' on node %s: %s", lu.LogWarning("Could not remove directory '%s' on node %s: %s",
......
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