Revision 5ff82cc9 lib/bdev.py

b/lib/bdev.py
2653 2653
    raise errors.ProgrammerError("Invalid block device type '%s'" % dev_type)
2654 2654

  
2655 2655

  
2656
def _VerifyDiskParams(disk):
2657
  """Verifies if all disk parameters are set.
2658

  
2659
  """
2660
  missing = set(constants.DISK_LD_DEFAULTS[disk.dev_type]) - set(disk.params)
2661
  if missing:
2662
    raise errors.ProgrammerError("Block device is missing disk parameters: %s" %
2663
                                 missing)
2664

  
2665

  
2656 2666
def FindDevice(disk, children):
2657 2667
  """Search for an existing, assembled device.
2658 2668

  
......
2688 2698

  
2689 2699
  """
2690 2700
  _VerifyDiskType(disk.dev_type)
2701
  _VerifyDiskParams(disk)
2691 2702
  device = DEV_MAP[disk.dev_type](disk.physical_id, children, disk.size,
2692 2703
                                  disk.params)
2693 2704
  device.Assemble()
......
2705 2716

  
2706 2717
  """
2707 2718
  _VerifyDiskType(disk.dev_type)
2719
  _VerifyDiskParams(disk)
2708 2720
  device = DEV_MAP[disk.dev_type].Create(disk.physical_id, children, disk.size,
2709 2721
                                         disk.params)
2710 2722
  return device

Also available in: Unified diff