summaryrefslogtreecommitdiffstats
path: root/snaps/openstack/utils/heat_utils.py
diff options
context:
space:
mode:
authorspisarski <s.pisarski@cablelabs.com>2018-02-22 11:42:52 -0700
committerspisarski <s.pisarski@cablelabs.com>2018-02-22 11:42:52 -0700
commitc711acf8ae3e4ad6f746500747857bcc9fd6f7be (patch)
tree4eeba467b4f42b37e935ccfff6b547bd11c65778 /snaps/openstack/utils/heat_utils.py
parentf3553913925b8ee5869c8e06047d6e4161a968c7 (diff)
Changed pattern on how objects lookup themselves by name and project.
The pattern being replaced has unwittingly added the requirement that all creator credentials must be of type 'admin' as when looking up the associated project ID required a call to keystone.projects.list(). As the SNAPS integration tests were always creating users with an 'admin' role, this issue was not caught. As part of this patch, integration test users will no longer be admin. JIRA: SNAPS-274 Change-Id: I02957f69e31a9d4dfa63362d371f061687e59fbf Signed-off-by: spisarski <s.pisarski@cablelabs.com>
Diffstat (limited to 'snaps/openstack/utils/heat_utils.py')
-rw-r--r--snaps/openstack/utils/heat_utils.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/snaps/openstack/utils/heat_utils.py b/snaps/openstack/utils/heat_utils.py
index 6e54dc6..0511ac8 100644
--- a/snaps/openstack/utils/heat_utils.py
+++ b/snaps/openstack/utils/heat_utils.py
@@ -257,14 +257,15 @@ def get_stack_security_groups(heat_cli, neutron, stack):
return out
-def get_stack_servers(heat_cli, nova, neutron, stack, project_id):
+def get_stack_servers(heat_cli, nova, neutron, keystone, stack, project_name):
"""
Returns a list of VMInst domain objects associated with a Stack
:param heat_cli: the OpenStack heat client object
:param nova: the OpenStack nova client object
:param neutron: the OpenStack neutron client object
+ :param keystone: the OpenStack keystone client object
:param stack: the SNAPS-OO Stack domain object
- :param project_id: the associated project ID
+ :param project_name: the associated project ID
:return: a list of VMInst domain objects
"""
@@ -273,7 +274,7 @@ def get_stack_servers(heat_cli, nova, neutron, stack, project_id):
for resource in srvr_res:
try:
server = nova_utils.get_server_object_by_id(
- nova, neutron, resource.id, project_id)
+ nova, neutron, keystone, resource.id, project_name)
if server:
out.append(server)
except NotFound:
@@ -287,7 +288,7 @@ def get_stack_servers(heat_cli, nova, neutron, stack, project_id):
heat_cli, res_res.id, 'OS::Nova::Server')
for res_srvr in res_res_srvrs:
server = nova_utils.get_server_object_by_id(
- nova, neutron, res_srvr.id, project_id)
+ nova, neutron, keystone, res_srvr.id, project_name)
if server:
out.append(server)