Revision c074a9e8 lib/bootstrap.py

b/lib/bootstrap.py
372 372
                maintain_node_health=False, drbd_helper=None, uid_pool=None,
373 373
                default_iallocator=None, primary_ip_version=None, ipolicy=None,
374 374
                prealloc_wipe_disks=False, use_external_mip_script=False,
375
                hv_state=None, disk_state=None):
375
                hv_state=None, disk_state=None, enabled_storage_types=None):
376 376
  """Initialise the cluster.
377 377

  
378 378
  @type candidate_pool_size: int
379 379
  @param candidate_pool_size: master candidate pool size
380
  @type enabled_storage_types: list of string
381
  @param enabled_storage_types: list of storage types to be used in this
382
    cluster
380 383

  
381 384
  """
382 385
  # TODO: complete the docstring
......
393 396
                               " entries: %s" % invalid_hvs,
394 397
                               errors.ECODE_INVAL)
395 398

  
399
  if not enabled_storage_types:
400
    raise errors.OpPrereqError("Enabled storage types list must contain at"
401
                               " least one member", errors.ECODE_INVAL)
402
  invalid_storage_types = \
403
    set(enabled_storage_types) - constants.VALID_STORAGE_TYPES
404
  if invalid_storage_types:
405
    raise errors.OpPrereqError("Enabled storage_types contains invalid"
406
                               " entries: %s" % invalid_storage_types,
407
                               errors.ECODE_INVAL)
408

  
396 409
  try:
397 410
    ipcls = netutils.IPAddress.GetClassFromIpVersion(primary_ip_version)
398 411
  except errors.ProgrammerError:
......
621 634
    ipolicy=full_ipolicy,
622 635
    hv_state_static=hv_state,
623 636
    disk_state_static=disk_state,
637
    enabled_storage_types=enabled_storage_types,
624 638
    )
625 639
  master_node_config = objects.Node(name=hostname.name,
626 640
                                    primary_ip=hostname.ip,

Also available in: Unified diff