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 2011/03/18 19:16:05 UTC

svn commit: r1083001 - /incubator/deltacloud/trunk/server/lib/deltacloud/base_driver/base_driver.rb

Author: lutter
Date: Fri Mar 18 18:16:04 2011
New Revision: 1083001

URL: http://svn.apache.org/viewvc?rev=1083001&view=rev
Log:
Make filtering of HWP by id work

Modified:
    incubator/deltacloud/trunk/server/lib/deltacloud/base_driver/base_driver.rb

Modified: incubator/deltacloud/trunk/server/lib/deltacloud/base_driver/base_driver.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/lib/deltacloud/base_driver/base_driver.rb?rev=1083001&r1=1083000&r2=1083001&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/lib/deltacloud/base_driver/base_driver.rb (original)
+++ incubator/deltacloud/trunk/server/lib/deltacloud/base_driver/base_driver.rb Fri Mar 18 18:16:04 2011
@@ -68,7 +68,7 @@ module Deltacloud
     end
 
     def hardware_profile(credentials, name)
-      hardware_profiles(credentials, :name => name).first
+      hardware_profiles(credentials, :id => name).first
     end
 
     def filter_hardware_profiles(profiles, opts)
@@ -76,7 +76,8 @@ module Deltacloud
         if v = opts[:architecture]
           profiles = profiles.select { |hwp| hwp.include?(:architecture, v) }
         end
-        if v = opts[:name]
+        # As a request param, we call 'name' 'id'
+        if v = opts[:id]
           profiles = profiles.select { |hwp| hwp.name == v }
         end
       end
@@ -86,7 +87,7 @@ module Deltacloud
     def find_hardware_profile(credentials, name, image_id)
       hwp = nil
       if name
-        unless hwp = hardware_profiles(credentials, :name => name).first
+        unless hwp = hardware_profiles(credentials, :id => name).first
           raise BackendError.new(400, "bad-hardware-profile-name",
             "Hardware profile '#{name}' does not exist", nil)
         end