summaryrefslogtreecommitdiffstats
path: root/snaps/config/network.py
diff options
context:
space:
mode:
authorspisarski <s.pisarski@cablelabs.com>2018-02-27 13:27:47 -0700
committerspisarski <s.pisarski@cablelabs.com>2018-02-27 14:58:03 -0700
commit65f23fa8e2f0a6a402546229a321a5fea4bc2ffb (patch)
tree35f22cc15366cac91b9d0529a6242820eeebad3f /snaps/config/network.py
parentc711acf8ae3e4ad6f746500747857bcc9fd6f7be (diff)
Fixed subnet gateway support to allow for disabling the gateway.
JIRA: SNAPS-276 Change-Id: Ia676b91ee881097ca7502fb4b9f5c64961de2214 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
Diffstat (limited to 'snaps/config/network.py')
-rw-r--r--snaps/config/network.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/snaps/config/network.py b/snaps/config/network.py
index a2d008a..6805b30 100644
--- a/snaps/config/network.py
+++ b/snaps/config/network.py
@@ -175,7 +175,10 @@ class SubnetConfig(object):
through authorization policies (optional)
:param start: The start address for the allocation pools (optional)
:param end: The end address for the allocation pools (optional)
- :param gateway_ip: The gateway IP address (optional)
+ :param gateway_ip: The gateway IP address (optional). When not
+ configured, the IP address will be automatically
+ assigned; when 'none', no gateway address will be
+ assigned, else the value must be valid
:param enable_dhcp: Set to true if DHCP is enabled and false if DHCP is
disabled (optional)
:param dns_nameservers: A list of DNS name servers for the subnet.
@@ -267,7 +270,10 @@ class SubnetConfig(object):
if self.start and self.end:
out['allocation_pools'] = [{'start': self.start, 'end': self.end}]
if self.gateway_ip:
- out['gateway_ip'] = self.gateway_ip
+ if self.gateway_ip == 'none':
+ out['gateway_ip'] = None
+ else:
+ out['gateway_ip'] = self.gateway_ip
if self.enable_dhcp is not None:
out['enable_dhcp'] = self.enable_dhcp
if self.dns_nameservers and len(self.dns_nameservers) > 0: