You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by lu...@apache.org on 2013/03/14 19:19:03 UTC
[9/15] git commit: CIMI: Apply $filter and $select in Base#list
CIMI: Apply $filter and $select in Base#list
No need to have ugly chained methods in collections.
Signed-off-by: Michal fojtik <mf...@redhat.com>
TrackedAt: http://tracker.deltacloud.org/patch/c2417e1f3383ae4a76e1d40d04440daed149bf95
Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/3303c375
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/3303c375
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/3303c375
Branch: refs/heads/master
Commit: 3303c375a9e5f963db69480d979b2ba5b0d94458
Parents: cc6f919
Author: Michal Fojtik <mf...@redhat.com>
Authored: Fri Mar 1 12:15:57 2013 +0100
Committer: David Lutterkort <lu...@redhat.com>
Committed: Wed Mar 13 17:28:13 2013 -0700
----------------------------------------------------------------------
server/lib/cimi/collections/machines.rb | 2 +-
server/lib/cimi/service/base.rb | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/3303c375/server/lib/cimi/collections/machines.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/collections/machines.rb b/server/lib/cimi/collections/machines.rb
index 0337f86..f3cb62a 100644
--- a/server/lib/cimi/collections/machines.rb
+++ b/server/lib/cimi/collections/machines.rb
@@ -24,7 +24,7 @@ module CIMI::Collections
operation :index, :with_capability => :instances do
description "List all machines"
control do
- machines = Machine.list(self).select_by(params['$select']).filter_by(params['$filter'])
+ machines = Machine.list(self)
respond_to do |format|
format.xml { machines.to_xml }
format.json { machines.to_json }
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/3303c375/server/lib/cimi/service/base.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/service/base.rb b/server/lib/cimi/service/base.rb
index 7df57f6..8daa183 100644
--- a/server/lib/cimi/service/base.rb
+++ b/server/lib/cimi/service/base.rb
@@ -117,7 +117,7 @@ module CIMI::Service
params = {}
params[:desc] = "#{self.name.split("::").last} Collection for the #{ctx.driver.name.capitalize} driver"
params[:add_url] = create_url(ctx)
- model_class.list(id, entries, params)
+ model_class.list(id, entries, params).select_by(ctx.params['$select']).filter_by(ctx.params['$filter'])
end
def self.create_url(ctx)