Add support for modules in cluster create/grow
When the module support was added, passing the modules to the actual create was not done on the server side. This has been added. Partial Bug: #1578917 Change-Id: I80c8e230f8bff550851f5cad146aa5976f45e5c4
This commit is contained in:
parent
7c46c3734d
commit
b928ec680a
@ -0,0 +1,6 @@
|
||||
---
|
||||
features:
|
||||
- Support was added for applying modules to
|
||||
cluster instances through cluster-create
|
||||
and cluster-grow. Bug 1578917
|
||||
|
@ -278,6 +278,8 @@ class Cluster(object):
|
||||
instance['name'] = node['name']
|
||||
if 'volume' in node:
|
||||
instance['volume_size'] = int(node['volume']['size'])
|
||||
if 'modules' in node:
|
||||
instance['modules'] = node['modules']
|
||||
instances.append(instance)
|
||||
return self.grow(instances)
|
||||
elif action == 'shrink':
|
||||
|
@ -158,6 +158,7 @@ class ClusterController(wsgi.Controller):
|
||||
for node in nodes:
|
||||
flavor_id = utils.get_id_from_href(node['flavorRef'])
|
||||
volume_size = volume_type = nics = availability_zone = None
|
||||
modules = None
|
||||
if 'volume' in node:
|
||||
volume_size = int(node['volume']['size'])
|
||||
volume_type = node['volume'].get('volume_type')
|
||||
@ -165,12 +166,15 @@ class ClusterController(wsgi.Controller):
|
||||
nics = node['nics']
|
||||
if 'availability_zone' in node:
|
||||
availability_zone = node['availability_zone']
|
||||
if 'modules' in node:
|
||||
modules = node['modules']
|
||||
|
||||
instances.append({"flavor_id": flavor_id,
|
||||
"volume_size": volume_size,
|
||||
"volume_type": volume_type,
|
||||
"nics": nics,
|
||||
"availability_zone": availability_zone})
|
||||
"availability_zone": availability_zone,
|
||||
"modules": modules})
|
||||
|
||||
locality = body['cluster'].get('locality')
|
||||
if locality:
|
||||
|
@ -288,6 +288,7 @@ cluster = {
|
||||
"volume": volume,
|
||||
"nics": nics,
|
||||
"availability_zone": non_empty_string,
|
||||
"modules": module_list,
|
||||
"related_to": non_empty_string,
|
||||
"type": non_empty_string
|
||||
}
|
||||
|
@ -155,7 +155,8 @@ class CassandraCluster(models.Cluster):
|
||||
availability_zone=instance_az,
|
||||
configuration_id=None,
|
||||
cluster_config=member_config,
|
||||
locality=locality)
|
||||
locality=locality,
|
||||
modules=instance.get('modules'))
|
||||
|
||||
new_instances.append(new_instance)
|
||||
|
||||
|
@ -139,7 +139,8 @@ class GaleraCommonCluster(cluster_models.Cluster):
|
||||
nics=instance.get('nics', None),
|
||||
configuration_id=None,
|
||||
cluster_config=member_config,
|
||||
locality=locality
|
||||
locality=locality,
|
||||
modules=instance.get('modules')
|
||||
)
|
||||
for instance in instances]
|
||||
|
||||
|
@ -146,7 +146,8 @@ class MongoDbCluster(models.Cluster):
|
||||
nics=nics[i],
|
||||
configuration_id=None,
|
||||
cluster_config=member_config,
|
||||
locality=locality)
|
||||
locality=locality,
|
||||
modules=instances[i].get('modules'))
|
||||
|
||||
for i in range(1, num_configsvr + 1):
|
||||
instance_name = "%s-%s-%s" % (name, "configsvr", str(i))
|
||||
|
@ -105,7 +105,8 @@ class RedisCluster(models.Cluster):
|
||||
cluster_config={
|
||||
"id": db_info.id,
|
||||
"instance_type": "member"},
|
||||
locality=locality
|
||||
locality=locality,
|
||||
modules=instance.get('modules')
|
||||
)
|
||||
for instance in instances]
|
||||
|
||||
|
@ -133,17 +133,13 @@ class VerticaCluster(models.Cluster):
|
||||
instance_name = "%s-member-%s" % (db_info.name,
|
||||
str(i + num_existing + 1))
|
||||
minstances.append(
|
||||
inst_models.Instance.create(context, instance_name,
|
||||
flavor_id,
|
||||
datastore_version.image_id,
|
||||
[], [], datastore,
|
||||
datastore_version,
|
||||
volume_size, None,
|
||||
nics=nics[i],
|
||||
availability_zone=azs[i],
|
||||
configuration_id=None,
|
||||
cluster_config=member_config,
|
||||
locality=locality)
|
||||
inst_models.Instance.create(
|
||||
context, instance_name, flavor_id,
|
||||
datastore_version.image_id, [], [], datastore,
|
||||
datastore_version, volume_size, None,
|
||||
nics=nics[i], availability_zone=azs[i],
|
||||
configuration_id=None, cluster_config=member_config,
|
||||
locality=locality, modules=instances[i].get('modules'))
|
||||
)
|
||||
return minstances
|
||||
|
||||
|
@ -176,6 +176,7 @@ class TestClusterController(TestCase):
|
||||
'volume_type': None,
|
||||
'flavor_id': '1234',
|
||||
'availability_zone': 'az',
|
||||
'modules': None,
|
||||
'nics': [
|
||||
{'net-id': 'e89aa5fd-6b0a-436d-a75c-1545d34d5331'}
|
||||
]
|
||||
|
@ -141,6 +141,7 @@ class TestClusterController(trove_testtools.TestCase):
|
||||
'volume_type': None,
|
||||
'flavor_id': '1234',
|
||||
'availability_zone': 'az',
|
||||
'modules': None,
|
||||
'nics': [
|
||||
{'net-id': 'e89aa5fd-6b0a-436d-a75c-1545d34d5331'}
|
||||
]
|
||||
|
@ -156,6 +156,7 @@ class TestClusterController(trove_testtools.TestCase):
|
||||
'volume_type': None,
|
||||
"flavor_id": "1234",
|
||||
"availability_zone": "az",
|
||||
'modules': None,
|
||||
"nics": [
|
||||
{"net-id": "e89aa5fd-6b0a-436d-a75c-1545d34d5331"}
|
||||
]
|
||||
@ -165,6 +166,7 @@ class TestClusterController(trove_testtools.TestCase):
|
||||
'volume_type': None,
|
||||
"flavor_id": "1234",
|
||||
"availability_zone": "az",
|
||||
'modules': None,
|
||||
"nics": [
|
||||
{"net-id": "e89aa5fd-6b0a-436d-a75c-1545d34d5331"}
|
||||
]
|
||||
@ -174,6 +176,7 @@ class TestClusterController(trove_testtools.TestCase):
|
||||
'volume_type': None,
|
||||
"flavor_id": "1234",
|
||||
"availability_zone": "az",
|
||||
'modules': None,
|
||||
"nics": [
|
||||
{"net-id": "e89aa5fd-6b0a-436d-a75c-1545d34d5331"}
|
||||
]
|
||||
|
@ -141,6 +141,7 @@ class TestClusterController(trove_testtools.TestCase):
|
||||
'volume_type': None,
|
||||
'flavor_id': '1234',
|
||||
'availability_zone': 'az',
|
||||
'modules': None,
|
||||
'nics': [
|
||||
{'net-id': 'e89aa5fd-6b0a-436d-a75c-1545d34d5331'}
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user