Revision 235a6b29 lib/backend.py

b/lib/backend.py
3801 3801
  shutil.rmtree(status_dir, ignore_errors=True)
3802 3802

  
3803 3803

  
3804
def _FindDisks(target_node_uuid, nodes_ip, disks):
3805
  """Sets the physical ID on disks and returns the block devices.
3804
def _SetPhysicalId(target_node_uuid, nodes_ip, disks):
3805
  """Sets the correct physical ID on all passed disks.
3806 3806

  
3807 3807
  """
3808
  # set the correct physical ID
3809 3808
  for cf in disks:
3810 3809
    cf.SetPhysicalID(target_node_uuid, nodes_ip)
3811 3810

  
3811

  
3812
def _FindDisks(target_node_uuid, nodes_ip, disks):
3813
  """Sets the physical ID on disks and returns the block devices.
3814

  
3815
  """
3816
  _SetPhysicalId(target_node_uuid, nodes_ip, disks)
3817

  
3812 3818
  bdevs = []
3813 3819

  
3814 3820
  for cf in disks:
......
3927 3933
  return (alldone, min_resync)
3928 3934

  
3929 3935

  
3936
def DrbdNeedsActivation(target_node_uuid, nodes_ip, disks):
3937
  """Checks which of the passed disks needs activation and returns their UUIDs.
3938

  
3939
  """
3940
  _SetPhysicalId(target_node_uuid, nodes_ip, disks)
3941
  faulty_disks = []
3942

  
3943
  for disk in disks:
3944
    rd = _RecursiveFindBD(disk)
3945
    if rd is None:
3946
      faulty_disks.append(disk)
3947
      continue
3948

  
3949
    stats = rd.GetProcStatus()
3950
    if stats.is_standalone or stats.is_diskless:
3951
      faulty_disks.append(disk)
3952

  
3953
  return [disk.uuid for disk in faulty_disks]
3954

  
3955

  
3930 3956
def GetDrbdUsermodeHelper():
3931 3957
  """Returns DRBD usermode helper currently configured.
3932 3958

  

Also available in: Unified diff