incubator-deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lut...@apache.org
Subject svn commit: r962026 - /incubator/deltacloud/trunk/drivers/mock/lib/mock_driver.rb
Date Thu, 08 Jul 2010 23:17:49 GMT
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
 
   # 



Mime
View raw message