deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@redhat.com
Subject [PATCH core 2/6] Mock: Added missing require and fixed realms param
Date Fri, 20 Jul 2012 15:45:13 GMT
From: Michal Fojtik <mfojtik@redhat.com>


Signed-off-by: Michal fojtik <mfojtik@redhat.com>
---
 server/lib/deltacloud/drivers/mock/mock_client.rb |    2 ++
 server/lib/deltacloud/drivers/mock/mock_driver.rb |    4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/server/lib/deltacloud/drivers/mock/mock_client.rb b/server/lib/deltacloud/drivers/mock/mock_client.rb
index 4c27a66..817ae0b 100644
--- a/server/lib/deltacloud/drivers/mock/mock_client.rb
+++ b/server/lib/deltacloud/drivers/mock/mock_client.rb
@@ -19,6 +19,8 @@
 
 module Deltacloud::Drivers::Mock
 
+  require 'fileutils'
+
   class Client
     def initialize(storage_root)
       @storage_root = storage_root
diff --git a/server/lib/deltacloud/drivers/mock/mock_driver.rb b/server/lib/deltacloud/drivers/mock/mock_driver.rb
index 582fb6a..5dbd730 100644
--- a/server/lib/deltacloud/drivers/mock/mock_driver.rb
+++ b/server/lib/deltacloud/drivers/mock/mock_driver.rb
@@ -91,7 +91,7 @@ module Deltacloud::Drivers::Mock
       @client = Client.new(storage_root)
     end
 
-    def realms(credentials, opts=nil)
+    def realms(credentials, opts={})
       check_credentials( credentials )
       results = []
       safely do
@@ -101,7 +101,6 @@ module Deltacloud::Drivers::Mock
         raise "NotImplementedTest" if opts and opts[:id] == "501"
         raise "ProviderErrorTest" if opts and opts[:id] == "502"
         raise "ProviderTimeoutTest" if opts and opts[:id] == "504"
-        return REALMS if ( opts.nil? )
         results = REALMS
       end
       results = filter_on( results, :id, opts )
@@ -189,6 +188,7 @@ module Deltacloud::Drivers::Mock
       end
 
       hwp = find_hardware_profile(credentials, opts[:hwp_id], image_id)
+      hwp ||= find_hardware_profile(credentials, 'm1-small', image_id)
 
       name = opts[:name] || "i-#{Time.now.to_i}"
 
-- 
1.7.10.2


Mime
View raw message