Merge "neutron: do not create default route for service subnet if connect_share_server_to_tenant_network is on"

This commit is contained in:
Zuul 2022-08-17 20:54:41 +00:00 committed by Gerrit Code Review
commit c81ff020f3
3 changed files with 9 additions and 2 deletions

View File

@ -241,13 +241,15 @@ class API(object):
raise exception.NetworkException(code=e.status_code,
message=e.message)
def subnet_create(self, tenant_id, net_id, name, cidr):
def subnet_create(self, tenant_id, net_id, name, cidr, no_gateway=False):
subnet_req_body = {'subnet': {}}
subnet_req_body['subnet']['tenant_id'] = tenant_id
subnet_req_body['subnet']['name'] = name
subnet_req_body['subnet']['network_id'] = net_id
subnet_req_body['subnet']['cidr'] = cidr
subnet_req_body['subnet']['ip_version'] = 4
if no_gateway:
subnet_req_body['subnet']['gateway_ip'] = None
try:
return self.client.create_subnet(
subnet_req_body).get('subnet', {})

View File

@ -893,7 +893,8 @@ class NeutronNetworkHelper(BaseNetworkhelper):
network_data['service_subnet'] = (
self.neutron_api.subnet_create(
self.admin_project_id, self.service_network_id,
subnet_name, self._get_cidr_for_subnet()))
subnet_name, self._get_cidr_for_subnet(),
self.connect_share_server_to_tenant_network))
network_data['ports'] = []

View File

@ -0,0 +1,4 @@
---
fixes:
- default route for service subnet wouldn't be created if
connect_share_server_to_tenant_network is on