Do not refresh data on filtering stuff by cluster

Listing nodes of node groups downloads all data from
Nailgun so there is no need to refresh it during the
following filtering by cluster id.

Closes-bug: #1378963
Change-Id: Ib9f45225f6e3c91809ea0dbc47e79b3529b54d3b
This commit is contained in:
Roman Prykhodchenko
2014-11-14 11:36:06 +01:00
parent f1cb1a433c
commit faa882b70e
2 changed files with 4 additions and 8 deletions

View File

@@ -152,7 +152,5 @@ class NodeCollection(object):
return cls(Node.get_all())
def filter_by_env_id(self, env_id):
self.collection = filter(
lambda node: node.env_id == env_id,
self.collection
)
predicate = lambda node: node.data['cluster'] == env_id
self.collection = filter(predicate, self.collection)

View File

@@ -81,7 +81,5 @@ class NodeGroupCollection(object):
return cls(NodeGroup.get_all())
def filter_by_env_id(self, env_id):
self.collection = filter(
lambda group: group.env_id == env_id,
self.collection
)
predicate = lambda group: group.data['cluster'] == env_id
self.collection = filter(predicate, self.collection)