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 2010/07/09 01:17:49 UTC
svn commit: r962026 -
/incubator/deltacloud/trunk/drivers/mock/lib/mock_driver.rb
Author: lutter
Date: Thu Jul 8 23:17:49 2010
New Revision: 962026
URL: http://svn.apache.org/viewvc?rev=962026&view=rev
Log:
Support opts[:architecture] for flavors.
Modified:
incubator/deltacloud/trunk/drivers/mock/lib/mock_driver.rb
Modified: incubator/deltacloud/trunk/drivers/mock/lib/mock_driver.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/drivers/mock/lib/mock_driver.rb?rev=962026&r1=962025&r2=962026&view=diff
==============================================================================
--- incubator/deltacloud/trunk/drivers/mock/lib/mock_driver.rb (original)
+++ incubator/deltacloud/trunk/drivers/mock/lib/mock_driver.rb Thu Jul 8 23:17:49 2010
@@ -4,8 +4,6 @@ require 'deltacloud/base_driver'
class MockDriver < DeltaCloud::BaseDriver
( STORAGE_ROOT = MOCK_STORAGE_ROOT ) unless defined?( STORAGE_ROOT )
- puts "Storage Root #{STORAGE_ROOT}"
- puts Dir[ "#{STORAGE_ROOT}/*" ].inspect
#
# Flavors
@@ -46,7 +44,14 @@ class MockDriver < DeltaCloud::BaseDrive
def flavors(credentials, opts=nil)
return FLAVORS if ( opts.nil? )
- FLAVORS.select{|f| opts[:id] == f[:id]}
+ results = FLAVORS
+ if ( opts[:id] )
+ results = results.select{|f| opts[:id] == f[:id]}
+ end
+ if ( opts[:architecture] )
+ results = results.select{|f| opts[:architecture] == f[:architecture]}
+ end
+ results
end
#