summaryrefslogtreecommitdiffstats
path: root/snaps/config/router.py
diff options
context:
space:
mode:
authorspisarski <s.pisarski@cablelabs.com>2018-02-16 08:35:07 -0700
committerspisarski <s.pisarski@cablelabs.com>2018-02-16 08:35:07 -0700
commit20902078a98bfb76c12919b92cd0345dd3c06f8c (patch)
tree3743db3bca563fe82b22d2ababa33d839f32cc57 /snaps/config/router.py
parent1b60980ee6b101261fb2115e417c4cf97cf29736 (diff)
Ensure project IDs are handled correctly for Network/Subnets
JIRA: SNAPS-265 Change-Id: If58f5817e52e21be377d2b06a5f7c3a413454350 Signed-off-by: spisarski <s.pisarski@cablelabs.com>
Diffstat (limited to 'snaps/config/router.py')
-rw-r--r--snaps/config/router.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/snaps/config/router.py b/snaps/config/router.py
index 72164f2..ae84038 100644
--- a/snaps/config/router.py
+++ b/snaps/config/router.py
@@ -61,7 +61,7 @@ class RouterConfig(object):
if not self.name:
raise RouterConfigError('Name is required')
- def dict_for_neutron(self, neutron, os_creds):
+ def dict_for_neutron(self, neutron, os_creds, project_id):
"""
Returns a dictionary object representing this object.
This is meant to be converted into JSON designed for use by the Neutron
@@ -70,7 +70,11 @@ class RouterConfig(object):
TODO - expand automated testing to exercise all parameters
:param neutron: The neutron client to retrieve external network
information if necessary
- :param os_creds: The OpenStack credentials
+ :param os_creds: The OpenStack credentials for retrieving the keystone
+ client for looking up the project ID when the
+ self.project_name is not None
+ :param project_id: the associated project ID to use when
+ self.project_name is None
:return: the dictionary object
"""
out = dict()
@@ -82,7 +86,6 @@ class RouterConfig(object):
keystone = keystone_utils.keystone_client(os_creds)
project = keystone_utils.get_project(
keystone=keystone, project_name=self.project_name)
- project_id = None
if project:
project_id = project.id
if project_id: