Revision 615551b2

b/lib/constants.py
457 457
# This only happens on an upgrade from a version of Ganeti that did not
458 458
# support the 'enabled_disk_templates' so far.
459 459
DISK_TEMPLATE_PREFERENCE = [
460
  DT_BLOCK,
461
  DT_DISKLESS,
460 462
  DT_DRBD8,
461
  DT_PLAIN,
463
  DT_EXT,
462 464
  DT_FILE,
463
  DT_SHARED_FILE,
465
  DT_PLAIN,
464 466
  DT_RBD,
465
  DT_BLOCK,
466
  DT_DISKLESS,
467
  DT_EXT
467
  DT_SHARED_FILE,
468 468
  ]
469 469

  
470 470
DISK_TEMPLATES = compat.UniqueFrozenset([
......
485 485
  ]
486 486

  
487 487
# mapping of disk templates to storage types
488
DISK_TEMPLATES_STORAGE_TYPE = {
488
MAP_DISK_TEMPLATE_STORAGE_TYPE = {
489 489
  DT_BLOCK: ST_BLOCK,
490 490
  DT_DISKLESS: ST_DISKLESS,
491 491
  DT_DRBD8: ST_LVM_VG,
b/lib/utils/storage.py
32 32
  """Given the storage type, returns a list of disk templates based on that
33 33
     storage type."""
34 34
  return [dt for dt in constants.DISK_TEMPLATES
35
          if constants.DISK_TEMPLATES_STORAGE_TYPE[dt] == storage_type]
35
          if constants.MAP_DISK_TEMPLATE_STORAGE_TYPE[dt] == storage_type]
36 36

  
37 37

  
38 38
def GetLvmDiskTemplates():
......
91 91
     storage
92 92

  
93 93
  """
94
  storage_type = constants.DISK_TEMPLATES_STORAGE_TYPE[disk_template]
94
  storage_type = constants.MAP_DISK_TEMPLATE_STORAGE_TYPE[disk_template]
95 95
  cluster = cfg.GetClusterInfo()
96 96
  if disk_template in GetLvmDiskTemplates():
97 97
    return (storage_type, cfg.GetVGName())
b/qa/qa_config.py
380 380

  
381 381
    """
382 382
    enabled_disk_templates = self.GetEnabledDiskTemplates()
383
    enabled_storage_types = list(set([constants.DISK_TEMPLATES_STORAGE_TYPE[dt]
384
                                      for dt in enabled_disk_templates]))
383
    enabled_storage_types = list(
384
        set([constants.MAP_DISK_TEMPLATE_STORAGE_TYPE[dt]
385
             for dt in enabled_disk_templates]))
385 386
    # Storage type 'lvm-pv' cannot be activated via a disk template,
386 387
    # therefore we add it if 'lvm-vg' is present.
387 388
    if constants.ST_LVM_VG in enabled_storage_types:
b/qa/qa_instance.py
88 88
  disk_template = info["Disk template"]
89 89
  if not disk_template:
90 90
    raise qa_error.Error("Can't get instance disk template")
91
  storage_type = constants.DISK_TEMPLATES_STORAGE_TYPE[disk_template]
91
  storage_type = constants.MAP_DISK_TEMPLATE_STORAGE_TYPE[disk_template]
92 92

  
93 93
  re_drbdnode = re.compile(r"^([^\s,]+),\s+minor=([0-9]+)$")
94 94
  vols = []

Also available in: Unified diff