| |
| import base_section |
| |
| from runtest import conditions |
| |
| |
| IRONIC_MICROVERSION_RELEASE_MAPPING = { |
| 'queens': |
| { |
| 'min_microversion': '1.1', |
| 'max_microversion': '1.38' |
| }, |
| 'pike': |
| { |
| 'min_microversion': '1.1', |
| 'max_microversion': '1.34' |
| }, |
| 'ocata': |
| { |
| 'min_microversion': '1.1', |
| 'max_microversion': '1.31' |
| }, |
| 'newton': |
| { |
| 'min_microversion': '1.1', |
| 'max_microversion': '1.22' |
| }, |
| 'mitaka': |
| { |
| 'min_microversion': '1.1', |
| 'max_microversion': '1.16' |
| } |
| } |
| |
| |
| class Baremetal(base_section.BaseSection): |
| |
| name = "baremetal" |
| options = [ |
| 'active_timeout', |
| 'adjusted_root_disk_size_gb', |
| 'association_timeout', |
| 'catalog_type', |
| 'deploywait_timeout', |
| 'driver', |
| 'enabled_deploy_interfaces', |
| 'enabled_drivers', |
| 'enabled_hardware_types', |
| 'endpoint_type', |
| 'max_microversion', |
| 'min_microversion', |
| 'partition_image_ref', |
| 'power_timeout', |
| 'unprovision_timeout', |
| 'use_provision_network', |
| 'whole_disk_image_checksum', |
| 'whole_disk_image_ref', |
| 'whole_disk_image_url', |
| ] |
| |
| |
| @property |
| def active_timeout(self): |
| pass |
| |
| @property |
| def adjusted_root_disk_size_gb(self): |
| pass |
| |
| @property |
| def association_timeout(self): |
| pass |
| |
| @property |
| def catalog_type(self): |
| pass |
| |
| @property |
| def deploywait_timeout(self): |
| pass |
| |
| @property |
| def driver(self): |
| pass |
| |
| @property |
| def enabled_deploy_interfaces(self): |
| c = conditions.BaseRule('ironic.conductor.enabled', 'eq', True) |
| enabled_deploy_interfaces = self.get_item_when_condition_match('ironic.conductor.enabled_deploy_interfaces', c) |
| if enabled_deploy_interfaces: |
| return enabled_deploy_interfaces |
| else: |
| return "iscsi,direct" |
| |
| @property |
| def enabled_drivers(self): |
| c = conditions.BaseRule('ironic.conductor.enabled', 'eq', True) |
| enabled_drivers = self.get_item_when_condition_match('ironic.conductor.enabled_drivers', c) |
| # ironic.conductor.enabled_drivers returns a list if it has several drivers |
| # in other cases it returns a string or None |
| if enabled_drivers: |
| if type(enabled_drivers) == list: |
| return ",".join(map(str, enabled_drivers)) |
| return enabled_drivers |
| return |
| |
| @property |
| def enabled_hardware_types(self): |
| c = conditions.BaseRule('ironic.conductor.enabled', 'eq', True) |
| enabled_hardware_types = self.get_item_when_condition_match('ironic.conductor.enabled_hardware_types', c) |
| if enabled_hardware_types: |
| return enabled_hardware_types |
| else: |
| return "ipmi" |
| |
| @property |
| def endpoint_type(self): |
| pass |
| |
| @property |
| def max_microversion(self): |
| c = conditions.BaseRule('ironic.conductor.enabled', 'eq', True) |
| baremetal_version = self.get_item_when_condition_match('ironic.conductor.version', c) |
| if baremetal_version and baremetal_version in IRONIC_MICROVERSION_RELEASE_MAPPING: |
| return IRONIC_MICROVERSION_RELEASE_MAPPING[baremetal_version]['max_microversion'] |
| |
| @property |
| def min_microversion(self): |
| c = conditions.BaseRule('ironic.conductor.enabled', 'eq', True) |
| baremetal_version = self.get_item_when_condition_match('ironic.conductor.version', c) |
| if baremetal_version and baremetal_version in IRONIC_MICROVERSION_RELEASE_MAPPING: |
| return IRONIC_MICROVERSION_RELEASE_MAPPING[baremetal_version]['min_microversion'] |
| |
| @property |
| def partition_image_ref(self): |
| pass |
| |
| @property |
| def power_timeout(self): |
| pass |
| |
| @property |
| def unprovision_timeout(self): |
| pass |
| |
| @property |
| def use_provision_network(self): |
| pass |
| |
| @property |
| def whole_disk_image_checksum(self): |
| pass |
| |
| @property |
| def whole_disk_image_ref(self): |
| pass |
| |
| @property |
| def whole_disk_image_url(self): |
| pass |