Fix creating subnet without gateway

If create_subnet() method is called with gateway=None explicity,
subnet should be created without gateway_ip specified.
To achieve that "gateway_ip=null" should be passed in json in
request's body to neutron server.
This was missing, so neutron-server allocated gateway_ip automatically.
Now gateway for such network will not be set as is expected.

Closes-Bug: #1769609

Change-Id: Ia9f0646a3cf371f82f2aa2dc22837249531d1ff5
This commit is contained in:
Slawek Kaplonski 2018-11-02 16:02:09 +01:00
parent cf38b77328
commit 21f5342de8
1 changed files with 2 additions and 0 deletions

View File

@ -431,6 +431,8 @@ class BaseNetworkTest(test.BaseTestCase):
ip_version=ip_version, cidr=cidr, mask_bits=mask_bits):
if gateway is not None:
kwargs['gateway_ip'] = str(gateway or (subnet_cidr.ip + 1))
else:
kwargs['gateway_ip'] = None
try:
body = client.create_subnet(
network_id=network['id'],