Remove nic handling in galera cluster grow
Since the nic is required to be specified in the cluster grow, remove the unnecessary nic handling in the Galera cluster grow. This would make it consistent with the way all the other clusters are handling the nic parameter. Change-Id: I136141b3db78b7a0a1804bb5e3d4ca5cf4bc3bb3 Closes-Bug: #1634629
This commit is contained in:
parent
8b7e6e6a79
commit
741b86b4cd
|
@ -146,14 +146,6 @@ class GaleraCommonCluster(cluster_models.Cluster):
|
|||
|
||||
return cls(context, db_info, datastore, datastore_version)
|
||||
|
||||
def _get_cluster_network_interfaces(self):
|
||||
nova_client = remote.create_nova_client(self.context)
|
||||
nova_instance_id = self.db_instances[0].compute_instance_id
|
||||
interfaces = nova_client.virtual_interfaces.list(nova_instance_id)
|
||||
ret = [{"net-id": getattr(interface, 'net_id')}
|
||||
for interface in interfaces]
|
||||
return ret
|
||||
|
||||
def grow(self, instances):
|
||||
LOG.debug("Growing cluster %s." % self.id)
|
||||
|
||||
|
@ -166,11 +158,6 @@ class GaleraCommonCluster(cluster_models.Cluster):
|
|||
|
||||
db_info.update(task_status=ClusterTasks.GROWING_CLUSTER)
|
||||
try:
|
||||
# Get the network of the existing cluster instances.
|
||||
interface_ids = self._get_cluster_network_interfaces()
|
||||
for instance in instances:
|
||||
instance["nics"] = interface_ids
|
||||
|
||||
locality = srv_grp.ServerGroup.convert_to_hint(self.server_group)
|
||||
new_instances = self._create_instances(
|
||||
context, db_info, datastore, datastore_version, instances,
|
||||
|
|
|
@ -310,8 +310,6 @@ class ClusterTest(trove_testtools.TestCase):
|
|||
self.cluster.delete()
|
||||
mock_update_db.assert_called_with(task_status=ClusterTasks.DELETING)
|
||||
|
||||
@patch.object(galera_api.GaleraCommonCluster,
|
||||
'_get_cluster_network_interfaces')
|
||||
@patch.object(DBCluster, 'update')
|
||||
@patch.object(galera_api, 'CONF')
|
||||
@patch.object(inst_models.Instance, 'create')
|
||||
|
@ -319,9 +317,8 @@ class ClusterTest(trove_testtools.TestCase):
|
|||
@patch.object(QUOTAS, 'check_quotas')
|
||||
@patch.object(remote, 'create_nova_client')
|
||||
def test_grow(self, mock_client, mock_check_quotas, mock_task_api,
|
||||
mock_inst_create, mock_conf, mock_update, mock_interfaces):
|
||||
mock_inst_create, mock_conf, mock_update):
|
||||
mock_client.return_value.flavors = Mock()
|
||||
mock_interfaces.return_value = [Mock()]
|
||||
self.cluster.grow(self.instances)
|
||||
mock_update.assert_called_with(
|
||||
task_status=ClusterTasks.GROWING_CLUSTER)
|
||||
|
@ -329,7 +326,6 @@ class ClusterTest(trove_testtools.TestCase):
|
|||
self.db_info.id,
|
||||
[mock_inst_create.return_value.id] * 3)
|
||||
self.assertEqual(3, mock_inst_create.call_count)
|
||||
self.assertEqual(1, mock_interfaces.call_count)
|
||||
|
||||
@patch.object(inst_models.DBInstance, 'find_all')
|
||||
@patch.object(inst_models.Instance, 'load')
|
||||
|
|
Loading…
Reference in New Issue