Revision bab4f56a qa/qa_config.py
b/qa/qa_config.py | ||
---|---|---|
435 | 435 |
return enabled and (not self.GetExclusiveStorage() or |
436 | 436 |
templ in constants.DTS_EXCL_STORAGE) |
437 | 437 |
|
438 |
def IsStorageTypeSupported(self, storage_type): |
|
439 |
"""Is the given storage type supported by the current configuration? |
|
440 |
|
|
441 |
This is determined by looking if at least one of the disk templates |
|
442 |
which is associated with the storage type is enabled in the configuration. |
|
443 |
|
|
444 |
""" |
|
445 |
enabled_disk_templates = self.GetEnabledDiskTemplates() |
|
446 |
if storage_type == constants.ST_LVM_PV: |
|
447 |
disk_templates = utils.GetDiskTemplatesOfStorageType(constants.ST_LVM_VG) |
|
448 |
else: |
|
449 |
disk_templates = utils.GetDiskTemplatesOfStorageType(storage_type) |
|
450 |
return bool(set(enabled_disk_templates).intersection(set(disk_templates))) |
|
451 |
|
|
438 | 452 |
def AreSpindlesSupported(self): |
439 | 453 |
"""Are spindles supported by the current configuration? |
440 | 454 |
|
... | ... | |
673 | 687 |
return GetConfig().IsTemplateSupported(templ) |
674 | 688 |
|
675 | 689 |
|
690 |
def IsStorageTypeSupported(storage_type): |
|
691 |
"""Wrapper for L{_QaConfig.IsTemplateSupported}. |
|
692 |
|
|
693 |
""" |
|
694 |
return GetConfig().IsStorageTypeSupported(storage_type) |
|
695 |
|
|
696 |
|
|
676 | 697 |
def AreSpindlesSupported(): |
677 | 698 |
"""Wrapper for L{_QaConfig.AreSpindlesSupported}. |
678 | 699 |
|
Also available in: Unified diff