diff options
author | Jenkins <jenkins@review.openstack.org> | 2015-02-11 13:39:17 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2015-02-11 13:39:17 +0000 |
commit | fc4946b816b24319966730d69642ad9360c35e2f (patch) | |
tree | 28b44e721cd578bf35ecbb9dfd612463bbe616e6 /tuskar_ui | |
parent | 51e6641fd847a59bdaa4da5a047bcfa01a584668 (diff) | |
parent | 18035440dfae10178abaa90cea4121d9320de696 (diff) | |
download | tuskar-ui-fc4946b816b24319966730d69642ad9360c35e2f.tar.gz |
Merge "Resource.get_by_node is already cached"
Diffstat (limited to 'tuskar_ui')
-rw-r--r-- | tuskar_ui/api/heat.py | 6 | ||||
-rw-r--r-- | tuskar_ui/infrastructure/roles/views.py | 2 |
2 files changed, 2 insertions, 6 deletions
diff --git a/tuskar_ui/api/heat.py b/tuskar_ui/api/heat.py index 2607a4bf..e9fd1827 100644 --- a/tuskar_ui/api/heat.py +++ b/tuskar_ui/api/heat.py @@ -418,10 +418,8 @@ class Resource(base.APIResourceWrapper): @classmethod @memoized.memoized def _resources_by_nodes(cls, request): - return dict( - (resource.physical_resource_id, resource) - for resource in cls.list_all_resources(request) - ) + return {resource.physical_resource_id: resource + for resource in cls.list_all_resources(request)} @classmethod def get_by_node(cls, request, node): diff --git a/tuskar_ui/infrastructure/roles/views.py b/tuskar_ui/infrastructure/roles/views.py index 59f235fa..726ce9fb 100644 --- a/tuskar_ui/infrastructure/roles/views.py +++ b/tuskar_ui/infrastructure/roles/views.py @@ -72,8 +72,6 @@ class DetailView(horizon_tables.DataTableView, views.RoleMixin, resources = stack.resources(role=role, with_joins=True) nodes = [r.node for r in resources] for node in nodes: - # TODO(tzumainn): this could probably be done more efficiently - # by getting the resource for all nodes at once try: resource = api.heat.Resource.get_by_node(self.request, node) except LookupError: |