You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by mf...@apache.org on 2013/02/19 14:00:57 UTC

[5/7] git commit: Mock: Require 'yaml' in client instead of driver

Mock: Require 'yaml' in client instead of driver

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.


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

Branch: refs/heads/master
Commit: 65c78552c6d4395d21a8aafb36fc2efd23491be1
Parents: 815a80d
Author: Michal Fojtik <mf...@redhat.com>
Authored: Mon Feb 18 14:25:32 2013 +0100
Committer: Michal fojtik <mf...@redhat.com>
Committed: Tue Feb 19 13:57:01 2013 +0100

----------------------------------------------------------------------
 server/lib/deltacloud/drivers/mock/mock_client.rb |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/65c78552/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 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