Revision b54ecf12 lib/objects.py

b/lib/objects.py
512 512

  
513 513
class Disk(ConfigObject):
514 514
  """Config object representing a block device."""
515
  __slots__ = ["name", "dev_type", "logical_id", "physical_id",
516
               "children", "iv_name", "size", "mode", "params"] + _UUID
515
  __slots__ = (["name", "dev_type", "logical_id", "physical_id",
516
                "children", "iv_name", "size", "mode", "params", "spindles"] +
517
               _UUID)
517 518

  
518 519
  def CreateOnSecondary(self):
519 520
    """Test if this device needs to be created on a secondary node."""
......
674 675
      raise errors.ProgrammerError("Disk.RecordGrow called for unsupported"
675 676
                                   " disk type %s" % self.dev_type)
676 677

  
677
  def Update(self, size=None, mode=None):
678
    """Apply changes to size and mode.
678
  def Update(self, size=None, mode=None, spindles=None):
679
    """Apply changes to size, spindles and mode.
679 680

  
680 681
    """
681 682
    if self.dev_type == constants.LD_DRBD8:
......
688 689
      self.size = size
689 690
    if mode is not None:
690 691
      self.mode = mode
692
    if spindles is not None:
693
      self.spindles = spindles
691 694

  
692 695
  def UnsetSize(self):
693 696
    """Sets recursively the size to zero for the disk and its children.
......
804 807
      val += ", not visible"
805 808
    else:
806 809
      val += ", visible as /dev/%s" % self.iv_name
810
    if self.spindles is not None:
811
      val += ", spindles=%s" % self.spindles
807 812
    if isinstance(self.size, int):
808 813
      val += ", size=%dm)>" % self.size
809 814
    else:

Also available in: Unified diff