lib/fog/azurerm/storage.rb in gitlab-fog-azure-rm-0.8.1 vs lib/fog/azurerm/storage.rb in gitlab-fog-azure-rm-0.9.0
- old
+ new
@@ -67,11 +67,12 @@
# This class provides the mock implementation for unit tests.
class Mock
def initialize(_options = {})
begin
- require 'azure/storage'
+ require 'azure/storage/common'
+ require 'azure/storage/blob'
rescue LoadError => e
retry if require('rubygems')
raise e.message
end
end
@@ -79,11 +80,12 @@
# This class provides the actual implementation for service calls.
class Real
def initialize(options)
begin
- require 'azure/storage'
+ require 'azure/storage/common'
+ require 'azure/storage/blob'
require 'securerandom'
@debug = ENV['DEBUG'] || options[:debug]
require 'azure/core/http/debug_filter' if @debug
rescue LoadError => e
retry if require('rubygems')
@@ -113,17 +115,17 @@
get_blob_endpoint(@azure_storage_account_name, true, @environment)
else
get_blob_endpoint_with_domain(@azure_storage_account_name, true, @azure_storage_domain)
end
- azure_client = Azure::Storage::Client.create(storage_account_name: @azure_storage_account_name,
- storage_access_key: @azure_storage_access_key,
- storage_blob_host: domain)
- @blob_client = azure_client.blob_client
- @blob_client.with_filter(Azure::Storage::Core::Filter::ExponentialRetryPolicyFilter.new)
+ azure_client = Azure::Storage::Common::Client.create(storage_account_name: @azure_storage_account_name,
+ storage_access_key: @azure_storage_access_key,
+ storage_blob_host: domain)
+ @blob_client = Azure::Storage::Blob::BlobService.new(client: azure_client)
+ @blob_client.with_filter(Azure::Storage::Common::Core::Filter::ExponentialRetryPolicyFilter.new)
@blob_client.with_filter(Azure::Core::Http::DebugFilter.new) if @debug
- @signature_client = Azure::Storage::Core::Auth::SharedAccessSignature.new(@azure_storage_account_name,
- @azure_storage_access_key)
+ @signature_client = Azure::Storage::Common::Core::Auth::SharedAccessSignature.new(@azure_storage_account_name,
+ @azure_storage_access_key)
end
end
end
end
end