deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject [5/6] git commit: Mock: Added missing require and fixed realms param
Date Mon, 23 Jul 2012 09:06:00 GMT
Mock: Added missing require and fixed realms param


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/40510dd3
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/40510dd3
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/40510dd3

Branch: refs/heads/master
Commit: 40510dd3cf2e953d7b6cadb6c3fd963cb860bba1
Parents: 94cfc44
Author: Michal Fojtik <mfojtik@redhat.com>
Authored: Fri Jul 20 15:37:19 2012 +0200
Committer: Michal fojtik <mfojtik@redhat.com>
Committed: Fri Jul 20 15:37:19 2012 +0200

----------------------------------------------------------------------
 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(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/40510dd3/server/lib/deltacloud/drivers/mock/mock_client.rb
----------------------------------------------------------------------
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

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/40510dd3/server/lib/deltacloud/drivers/mock/mock_driver.rb
----------------------------------------------------------------------
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}"
 


Mime
View raw message