Uses network_id instead of net-id
This PR changes the keyname in nics from `net-id` to `network_id`.
`net-id` is deprecated[1] since Victoria and some functions don't
work correctly.
Original problem:
Trove Clusters API returns errors when processing cluster creation
requests from trove-dashboard because trove-dashboard submit the
requests using the `net-id` whereas Trove Clusters API expects
`network_id` there.
[1]: 5590ecdce0
Story: 2010148
Task: 45792
Change-Id: If633e75b8078a060fca3f450a0960368c22e698d
This commit is contained in:
parent
a2d62eb141
commit
74e48f10d8
@ -77,7 +77,7 @@ def cluster_create(request, name, volume, flavor, num_instances,
|
||||
if volume > 0:
|
||||
instance["volume"] = {'size': volume}
|
||||
if nics:
|
||||
instance["nics"] = [{"net-id": nics}]
|
||||
instance["nics"] = [{"network_id": nics}]
|
||||
instances.append(instance)
|
||||
|
||||
# TODO(saurabhs): vertica needs root password on cluster create
|
||||
@ -103,7 +103,7 @@ def cluster_grow(request, cluster_id, new_instances):
|
||||
if new_instance.related_to:
|
||||
instance["related_to"] = new_instance.related_to
|
||||
if new_instance.nics:
|
||||
instance["nics"] = [{'net-id': new_instance.nics}]
|
||||
instance["nics"] = [{'network_id': new_instance.nics}]
|
||||
instances.append(instance)
|
||||
return troveclient(request).clusters.grow(cluster_id, instances)
|
||||
|
||||
|
@ -241,7 +241,7 @@ class DatabaseTests(test.TestCase):
|
||||
|
||||
self.mock_network_list_for_tenant.return_value = self.networks.list()
|
||||
|
||||
nics = [{"net-id": self.networks.first().id}]
|
||||
nics = [{"network_id": self.networks.first().id}]
|
||||
|
||||
datastore = 'mysql'
|
||||
datastore_version = '5.5'
|
||||
@ -329,7 +329,7 @@ class DatabaseTests(test.TestCase):
|
||||
|
||||
self.mock_network_list_for_tenant.return_value = self.networks.list()
|
||||
|
||||
nics = [{"net-id": self.networks.first().id}]
|
||||
nics = [{"network_id": self.networks.first().id}]
|
||||
|
||||
datastore = 'mysql'
|
||||
datastore_version = '5.5'
|
||||
@ -1056,7 +1056,7 @@ class DatabaseTests(test.TestCase):
|
||||
|
||||
self.mock_network_list_for_tenant.return_value = self.networks.list()
|
||||
|
||||
nics = [{"net-id": self.networks.first().id}]
|
||||
nics = [{"network_id": self.networks.first().id}]
|
||||
|
||||
self.mock_availability_zone_list.return_value = (
|
||||
self.availability_zones.list())
|
||||
|
@ -626,9 +626,8 @@ class LaunchInstance(workflows.Workflow):
|
||||
def _get_nics(self, context):
|
||||
netids = context.get('network_id', None)
|
||||
if netids:
|
||||
return [{"net-id": netid} for netid in netids]
|
||||
else:
|
||||
return None
|
||||
return [{"network_id": netid} for netid in netids]
|
||||
return None
|
||||
|
||||
def _get_volume_type(self, context):
|
||||
volume_type = None
|
||||
|
Loading…
x
Reference in New Issue
Block a user