summaryrefslogtreecommitdiffstats
path: root/snaps/config/router.py
diff options
context:
space:
mode:
authorspisarski <s.pisarski@cablelabs.com>2018-04-17 08:24:18 -0600
committerspisarski <s.pisarski@cablelabs.com>2018-04-19 15:20:51 -0600
commitf65dbaef830fe7121173fdb83e5e4dde09b11a8a (patch)
treefa2c1a7bdc5fdc10b28c8ba722ff324267e9444a /snaps/config/router.py
parentbd658dbe250e93a9fa4405b99ecdb2ad1a7029b6 (diff)
Fixed bug with regards to subnet lookups.
Neutron returns all subnets regardless of visibility which cause problems within routers if there is another subnet with the same name attached to a different network. JIRA: SNAPS-304 In addition, this patch contains two other minor fixes. launch_utils.py - raise an exception when the creator is not properly instantiated network.py - allow fixed IPs to be none. Change-Id: Ib343074d925be4592a713727a03d5b531890eada Signed-off-by: spisarski <s.pisarski@cablelabs.com>
Diffstat (limited to 'snaps/config/router.py')
-rw-r--r--snaps/config/router.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/snaps/config/router.py b/snaps/config/router.py
index 6b03ad2..2a0b6a4 100644
--- a/snaps/config/router.py
+++ b/snaps/config/router.py
@@ -33,7 +33,11 @@ class RouterConfig(object):
:param admin_state_up: The administrative status of the router.
True = up / False = down (default True)
:param internal_subnets: List of subnet names to which to connect this
- router for Floating IP purposes
+ router (this way is deprecated).
+ *** NEW WAY ***
+ List of dict where the key is 'subnet' that
+ contains members with the following keys:
+ project_name, network_name, and subnet_name
:param port_settings: List of PortConfig objects
:return:
"""
@@ -45,6 +49,19 @@ class RouterConfig(object):
self.enable_snat = kwargs.get('enable_snat')
if kwargs.get('internal_subnets'):
self.internal_subnets = kwargs['internal_subnets']
+ if isinstance(self.internal_subnets, dict):
+ if 'subnet' not in self.internal_subnets:
+ raise RouterConfigError(
+ 'subnet is a required key to internal_subnets')
+ if 'project_name' not in self.internal_subnets['subnet']:
+ raise RouterConfigError(
+ 'subnet.project is a required key to subnet')
+ if 'network_name' not in self.internal_subnets['subnet']:
+ raise RouterConfigError(
+ 'network_name is a required key to subnet')
+ if 'subnet_name' not in self.internal_subnets['subnet']:
+ raise RouterConfigError(
+ 'subnet_name is a required key to subnet')
else:
self.internal_subnets = list()