Merge "Support volume type in Sahara Node Group Template"

This commit is contained in:
Jenkins 2014-11-27 04:22:01 +00:00 committed by Gerrit Code Review
commit 1812a70a9b
2 changed files with 11 additions and 4 deletions

View File

@ -35,12 +35,12 @@ class SaharaNodeGroupTemplate(resource.Resource):
support_status = support.SupportStatus(version='2014.2') support_status = support.SupportStatus(version='2014.2')
PROPERTIES = ( PROPERTIES = (
NAME, PLUGIN_NAME, HADOOP_VERSION, FLAVOR, NAME, PLUGIN_NAME, HADOOP_VERSION, FLAVOR, DESCRIPTION,
DESCRIPTION, VOLUMES_PER_NODE, VOLUMES_SIZE, VOLUMES_PER_NODE, VOLUMES_SIZE, VOLUME_TYPE,
NODE_PROCESSES, FLOATING_IP_POOL, NODE_CONFIGS, NODE_PROCESSES, FLOATING_IP_POOL, NODE_CONFIGS,
) = ( ) = (
'name', 'plugin_name', 'hadoop_version', 'flavor', 'name', 'plugin_name', 'hadoop_version', 'flavor', 'description',
'description', 'volumes_per_node', 'volumes_size', 'volumes_per_node', 'volumes_size', 'volume_type',
'node_processes', 'floating_ip_pool', 'node_configs', 'node_processes', 'floating_ip_pool', 'node_configs',
) )
@ -87,6 +87,10 @@ class SaharaNodeGroupTemplate(resource.Resource):
constraints.Range(min=1), constraints.Range(min=1),
], ],
), ),
VOLUME_TYPE: properties.Schema(
properties.Schema.STRING,
_("Type of the volume to create on Cinder backend."),
),
NODE_PROCESSES: properties.Schema( NODE_PROCESSES: properties.Schema(
properties.Schema.LIST, properties.Schema.LIST,
_("List of processes to run on every node."), _("List of processes to run on every node."),
@ -130,6 +134,7 @@ class SaharaNodeGroupTemplate(resource.Resource):
self.properties[self.FLAVOR]) self.properties[self.FLAVOR])
volumes_per_node = self.properties.get(self.VOLUMES_PER_NODE) volumes_per_node = self.properties.get(self.VOLUMES_PER_NODE)
volumes_size = self.properties.get(self.VOLUMES_SIZE) volumes_size = self.properties.get(self.VOLUMES_SIZE)
volume_type = self.properties.get(self.VOLUME_TYPE)
floating_ip_pool = self.properties.get(self.FLOATING_IP_POOL) floating_ip_pool = self.properties.get(self.FLOATING_IP_POOL)
if floating_ip_pool: if floating_ip_pool:
floating_ip_pool = self.client_plugin( floating_ip_pool = self.client_plugin(
@ -144,6 +149,7 @@ class SaharaNodeGroupTemplate(resource.Resource):
description=description, description=description,
volumes_per_node=volumes_per_node, volumes_per_node=volumes_per_node,
volumes_size=volumes_size, volumes_size=volumes_size,
volume_type=volume_type,
node_processes=node_processes, node_processes=node_processes,
floating_ip_pool=floating_ip_pool, floating_ip_pool=floating_ip_pool,
node_configs=node_configs) node_configs=node_configs)

View File

@ -114,6 +114,7 @@ class SaharaNodeGroupTemplateTest(common.HeatTestCase):
expected_kwargs = {'description': "", expected_kwargs = {'description': "",
'volumes_per_node': None, 'volumes_per_node': None,
'volumes_size': None, 'volumes_size': None,
'volume_type': None,
'node_processes': ['namenode', 'jobtracker'], 'node_processes': ['namenode', 'jobtracker'],
'floating_ip_pool': 'some_pool_id', 'floating_ip_pool': 'some_pool_id',
'node_configs': None, 'node_configs': None,