From: Michal Fojtik <mfoj...@redhat.com>

The YAML is really required in MockClient (I think this
require is not required here anyway ;-)

This patch will also make .store() method return the stored
object, so in driver we don't need to create a special var for it.

Signed-off-by: Michal fojtik <mfoj...@redhat.com>
---
 server/lib/deltacloud/drivers/mock/mock_client.rb | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/server/lib/deltacloud/drivers/mock/mock_client.rb 
b/server/lib/deltacloud/drivers/mock/mock_client.rb
index 449b6a8..eb37176 100644
--- a/server/lib/deltacloud/drivers/mock/mock_client.rb
+++ b/server/lib/deltacloud/drivers/mock/mock_client.rb
@@ -19,6 +19,7 @@
 
 module Deltacloud::Drivers::Mock
 
+  require 'yaml'
   require 'fileutils'
 
   class Client
@@ -66,6 +67,7 @@ module Deltacloud::Drivers::Mock
     def store(collection, obj)
       raise "Why no obj[:id] ?" unless obj[:id]
       File::open(file(collection, obj[:id]), "w") { |f| YAML.dump(obj, f) }
+      obj
     end
 
     # Return the object with id +id+ of class +klass+ from the collection
-- 
1.8.1.2

Reply via email to