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/04/10 21:38:20 UTC
[4/6] git commit: Client: Reverted how we initialize 'current_driver'
and 'current_provider'
Client: Reverted how we initialize 'current_driver' and 'current_provider'
The current syntax in initializer cause unit tests explosions.
We should really first initialize the @request_driver to what user supplied
as :driver or :provider and only if these options are not provided
fallback to 'current_driver/current_provider' which are parsed from the API
entrypoint XML.
Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/a88c1f1a
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/a88c1f1a
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/a88c1f1a
Branch: refs/heads/master
Commit: a88c1f1a19335f959bfddf6c4df0f8381295818e
Parents: 01736b3
Author: Michal Fojtik <mf...@redhat.com>
Authored: Wed Apr 10 11:10:38 2013 +0200
Committer: Michal fojtik <mf...@redhat.com>
Committed: Wed Apr 10 21:31:36 2013 +0200
----------------------------------------------------------------------
client/lib/deltacloud/client/connection.rb | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/a88c1f1a/client/lib/deltacloud/client/connection.rb
----------------------------------------------------------------------
diff --git a/client/lib/deltacloud/client/connection.rb b/client/lib/deltacloud/client/connection.rb
index 4505cd9..a60b10a 100644
--- a/client/lib/deltacloud/client/connection.rb
+++ b/client/lib/deltacloud/client/connection.rb
@@ -41,6 +41,8 @@ module Deltacloud::Client
include Deltacloud::Client::Methods::StorageVolume
def initialize(opts={})
+ @request_driver = opts[:driver]
+ @request_provider = opts[:provider]
@connection = Faraday.new(:url => opts[:url]) do |f|
# NOTE: The order of this is somehow important for VCR
# recording.
@@ -51,8 +53,8 @@ module Deltacloud::Client
f.adapter :net_http
end
cache_entrypoint!
- @request_driver = opts[:driver] ||= current_driver
- @request_provider = opts[:provider] ||= current_provider
+ @request_driver ||= current_driver
+ @request_provider ||= current_provider
end
# Change the current driver and return copy of the client