Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update azure-storage to 1.1, unpin fog-core/fog-json #438

Merged
merged 1 commit into from
May 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions fog-azure-rm.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'minitest', '~> 5.8.4'
spec.add_development_dependency 'simplecov'
spec.add_development_dependency 'codeclimate-test-reporter' , '~> 1.0.0'
spec.add_dependency 'fog-core', '~> 1.43'
spec.add_dependency 'fog-json', '~> 1.0.2'
spec.add_dependency 'fog-core', '>= 1.43'
spec.add_dependency 'fog-json', '>= 1.0.2'
spec.add_dependency 'azure_mgmt_compute', '~> 0.9.0'
spec.add_dependency 'azure_mgmt_resources', '~> 0.9.0'
spec.add_dependency 'azure_mgmt_storage', '~> 0.9.0'
Expand All @@ -32,7 +32,8 @@ Gem::Specification.new do |spec|
spec.add_dependency 'azure_mgmt_traffic_manager', '~> 0.9.0'
spec.add_dependency 'azure_mgmt_sql', '~> 0.9.0'
spec.add_dependency 'azure_mgmt_key_vault', '~> 0.9.0'
spec.add_dependency 'azure-storage', '>= 0.11.5.preview', '< 1.0'
spec.add_dependency 'azure-storage-common', '~> 1.1'
spec.add_dependency 'azure-storage-blob', '~> 1.1'
spec.add_dependency 'vhd', '0.0.4'
spec.add_dependency 'mime-types', '~> 3.0'
end
2 changes: 1 addition & 1 deletion lib/fog/azurerm/compute.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def initialize(options)
begin
require 'azure_mgmt_compute'
require 'azure_mgmt_storage'
require 'azure/storage'
require 'azure/storage/common'
rescue LoadError => e
retry if require('rubygems')
raise e.message
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/azurerm/requests/compute/attach_data_disk_to_vm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def get_unmanaged_disk_object(disk_name, disk_size, lun, storage_account_name, a
end

def check_blob_exist(storage_account_name, blob_name, access_key)
client = Azure::Storage::Client.new(storage_account_name: storage_account_name, storage_access_key: access_key)
client = Azure::Storage::Common::Client.new(storage_account_name: storage_account_name, storage_access_key: access_key)
blob_service = Azure::Storage::Blob::BlobService.new(client: client)
begin
blob_prop = blob_service.get_blob_properties('vhds', blob_name)
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/azurerm/requests/storage/list_blobs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def list_blobs(container_name, options = {})
Fog::Logger.debug msg
temp = @blob_client.list_blobs(container_name, options)
# Workaround for the issue https://github.com/Azure/azure-storage-ruby/issues/37
raise temp unless temp.instance_of?(Azure::Service::EnumerationResults)
raise temp unless temp.instance_of?(Azure::Storage::Common::Service::EnumerationResults)

blobs += temp unless temp.empty?
break if temp.continuation_token.nil? || temp.continuation_token.empty?
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/azurerm/requests/storage/list_containers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def list_containers
Fog::Logger.debug msg
temp = @blob_client.list_containers(options)
# Workaround for the issue https://github.com/Azure/azure-storage-ruby/issues/37
raise temp unless temp.instance_of?(Azure::Service::EnumerationResults)
raise temp unless temp.instance_of?(Azure::Storage::Common::Service::EnumerationResults)

containers += temp unless temp.empty?
break if temp.continuation_token.nil? || temp.continuation_token.empty?
Expand Down
11 changes: 6 additions & 5 deletions lib/fog/azurerm/storage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ class Real
def initialize(options)
begin
require 'azure_mgmt_storage'
require 'azure/storage'
require 'azure/storage/common'
require 'azure/storage/blob'
require 'securerandom'
require 'vhd'
@debug = ENV['DEBUG'] || options[:debug]
Expand Down Expand Up @@ -134,11 +135,11 @@ def initialize(options)
storage_endpoint_suffix(@environment)[1..-1]
end

azure_client = Azure::Storage::Client.create(client_options)
@blob_client = azure_client.blob_client
@blob_client.with_filter(Azure::Storage::Core::Filter::ExponentialRetryPolicyFilter.new)
azure_client = Azure::Storage::Common::Client.create(client_options)
@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,
@signature_client = Azure::Storage::Common::Core::Auth::SharedAccessSignature.new(@azure_storage_account_name,
@azure_storage_access_key)
end
end
Expand Down
4 changes: 2 additions & 2 deletions test/requests/storage/test_list_blobs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ def setup
@blob_client = @service.instance_variable_get(:@blob_client)

@blob_list = ApiStub::Requests::Storage::File.blob_list
@blobs1 = Azure::Service::EnumerationResults.new
@blobs1 = Azure::Storage::Common::Service::EnumerationResults.new
@blobs1.continuation_token = 'marker'
@blobs1.push(@blob_list[0])
@blobs1.push(@blob_list[1])
@blobs2 = Azure::Service::EnumerationResults.new
@blobs2 = Azure::Storage::Common::Service::EnumerationResults.new
@blobs2.push(@blob_list[2])
@blobs2.push(@blob_list[3])
end
Expand Down
4 changes: 2 additions & 2 deletions test/requests/storage/test_list_containers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ def setup
@blob_client = @service.instance_variable_get(:@blob_client)

@containers = ApiStub::Requests::Storage::Directory.container_list
@containers1 = Azure::Service::EnumerationResults.new
@containers1 = Azure::Storage::Common::Service::EnumerationResults.new
@containers1.continuation_token = 'marker'
@containers1.push(@containers[0])
@containers1.push(@containers[1])
@containers2 = Azure::Service::EnumerationResults.new
@containers2 = Azure::Storage::Common::Service::EnumerationResults.new
@containers2.push(@containers[2])
end

Expand Down