diff options
author | spisarski <s.pisarski@cablelabs.com> | 2018-04-17 08:24:18 -0600 |
---|---|---|
committer | Steven Pisarski <s.pisarski@cablelabs.com> | 2018-04-19 22:08:39 +0000 |
commit | 4edc3d87392cf78c3f046217543fb76380413306 (patch) | |
tree | b138f146044ca1ff457ff25ac065bbdaeda6d320 /snaps/config/router.py | |
parent | 844c049771c5b66eb7bd77e6f18f321674689d54 (diff) |
Fixed bug with regards to subnet lookups.opnfv-6.1.0opnfv-6.0.0
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.py | 19 |
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() |