Revision 318bbaa9 qa/qa_instance.py

b/qa/qa_instance.py
888 888

  
889 889

  
890 890
def TestRemoveInstanceOfflineNode(instance, snode, set_offline, set_online):
891
  """gtn-instance remove with an off-line node
891
  """gnt-instance remove with an off-line node
892 892

  
893 893
  @param instance: instance
894 894
  @param snode: secondary node, to be set offline
......
902 902
    TestInstanceRemove(instance)
903 903
  finally:
904 904
    set_online(snode)
905
  # Clean up the disks on the offline node
906
  for minor in info["drbd-minors"][snode.primary]:
907
    AssertCommand(["drbdsetup", str(minor), "down"], node=snode)
908
  AssertCommand(["lvremove", "-f"] + info["volumes"], node=snode)
905

  
906
  # Clean up the disks on the offline node, if necessary
907
  if instance.disk_template not in constants.DTS_EXT_MIRROR:
908
    # FIXME: abstract the cleanup inside the disks
909
    if info["storage-type"] == constants.ST_LVM_VG:
910
      for minor in info["drbd-minors"][snode.primary]:
911
        AssertCommand(["drbdsetup", str(minor), "down"], node=snode)
912
      AssertCommand(["lvremove", "-f"] + info["volumes"], node=snode)
913
    elif info["storage-type"] == constants.ST_FILE:
914
      filestorage = pathutils.DEFAULT_FILE_STORAGE_DIR
915
      disk = os.path.join(filestorage, instance.name)
916
      AssertCommand(["rm", "-rf", disk], node=snode)

Also available in: Unified diff