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
diff --git a/neutron_tempest_plugin/api/base.py b/neutron_tempest_plugin/api/base.py
index c4bc71d..028d901 100644
--- a/neutron_tempest_plugin/api/base.py
+++ b/neutron_tempest_plugin/api/base.py
@@ -431,6 +431,8 @@
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'],