summaryrefslogtreecommitdiffstats
path: root/snaps/openstack/create_router.py
diff options
context:
space:
mode:
authorspisarski <s.pisarski@cablelabs.com>2017-07-24 11:27:59 -0600
committerspisarski <s.pisarski@cablelabs.com>2017-07-24 11:27:59 -0600
commit3d6ec1eeaf70ae4e46042946f8bd35d5b5380401 (patch)
tree9d2881a2f73de6e779d266ceb6798ec3930d42ea /snaps/openstack/create_router.py
parentfeae63d11f8295a0d9327496f42949ad5b67fca4 (diff)
Fixed problems when setting the OpenStack project ID.
There were several calls to retrieve the project ID that required named parameters which was causing the utility function to always return None. Additionally, when creating the dict() required by the Neutron create API 'body' parameter key 'project_id' is not supported and still uses 'tenant_id'. As these problems should have been found earlier, this patch also extends the tests for networks, subnets, ports, and security groups to use 'tenant_id' rather than 'project_id'. JIRA: SNAPS-143 Change-Id: Ic69e56145ea6070718d821edd22a1d0f9970995d Signed-off-by: spisarski <s.pisarski@cablelabs.com>
Diffstat (limited to 'snaps/openstack/create_router.py')
-rw-r--r--snaps/openstack/create_router.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/snaps/openstack/create_router.py b/snaps/openstack/create_router.py
index e50009c..acf6602 100644
--- a/snaps/openstack/create_router.py
+++ b/snaps/openstack/create_router.py
@@ -238,12 +238,13 @@ class RouterSettings:
out['name'] = self.name
if self.project_name:
keystone = keystone_utils.keystone_client(os_creds)
- project = keystone_utils.get_project(keystone, self.project_name)
+ project = keystone_utils.get_project(
+ keystone=keystone, project_name=self.project_name)
project_id = None
if project:
project_id = project.id
if project_id:
- out['project_id'] = project_id
+ out['tenant_id'] = project_id
else:
raise RouterSettingsError(
'Could not find project ID for project named - ' +