Skip to content

Commit

Permalink
Updated to storage service version 2015-04-05
Browse files Browse the repository at this point in the history
  • Loading branch information
yaxia authored and vinjiang committed Jun 30, 2016
1 parent fa7d350 commit 64fafba
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 17 deletions.
3 changes: 2 additions & 1 deletion ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
2016.07 - version 0.10.2
2016.06 - version 0.10.2

ALL
* Fixed the issue that cannot run against storage emulator on Windows.
* Fixed the issue that it doesn't run as a singleton when it calls Azure::Storage.setup.
* Updated to storage service version 2015-04-05.

2016.05 - version 0.10.1

Expand Down
4 changes: 1 addition & 3 deletions lib/azure/storage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,4 @@ def method_missing(method_name, *args, &block)

end
end

Azure::Storage.setup
end
end
2 changes: 1 addition & 1 deletion lib/azure/storage/blob/blob_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ def break_lease(container, blob, options={})
protected
def containers_uri(query={})
query = { 'comp' => 'list' }.merge(query)
generate_uri('/', query)
generate_uri('', query)
end

# Protected: Generate the URI for a specific container.
Expand Down
6 changes: 5 additions & 1 deletion lib/azure/storage/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,11 @@ class Client
#
# @return [Azure::Storage::Client]
def initialize(options = {})
options = setup_options if options.is_a?(Hash) && options.length == 0
if options.is_a?(Hash)
options = setup_options if options.length == 0
options = parse_connection_string(options[:storage_connection_string]) if options[:storage_connection_string]
end

reset!(options)
end

Expand Down
1 change: 0 additions & 1 deletion lib/azure/storage/client_options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ def reset!(options = {})

# Check if this client is configured with the same options
def same_options?(opts)
opts = load_env if opts.length == 0
opts.length == 0 || opts.hash == options.hash
end

Expand Down
2 changes: 1 addition & 1 deletion lib/azure/storage/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
module Azure::Storage
module Default
# Default REST service (STG) version number
STG_VERSION = '2015-02-21'
STG_VERSION = '2015-04-05'

# The number of default concurrent requests for parallel operation.
DEFAULT_PARALLEL_OPERATION_THREAD_COUNT = 1
Expand Down
8 changes: 6 additions & 2 deletions lib/azure/storage/service/storage_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,11 @@ def service_properties_uri(query={})
# Returns the uri hash
def generate_uri(path='', query={})
if self.client.is_a?(Azure::Storage::Client) && self.client.options[:use_path_style_uri]
path += self.client.options[:storage_account_name]
if path.length > 0
path = self.client.options[:storage_account_name] + '/' + path
else
path = self.client.options[:storage_account_name]
end
end

super path, query
Expand Down Expand Up @@ -147,4 +151,4 @@ def service_properties_headers

end
end
end
end
2 changes: 1 addition & 1 deletion lib/azure/storage/service/storage_service_properties.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ def initialize
attr_accessor :default_service_version
end
end
end
end
2 changes: 1 addition & 1 deletion lib/azure/storage/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Version
# Fields represent the parts defined in http://semver.org/
MAJOR = 0 unless defined? MAJOR
MINOR = 10 unless defined? MINOR
UPDATE = 1 unless defined? UPDATE
UPDATE = 2 unless defined? UPDATE
PRE = 'preview' unless defined? PRE

class << self
Expand Down
4 changes: 2 additions & 2 deletions test/unit/config/client_services_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
describe 'create client with options' do
let(:azure_storage_account) {"testStorageAccount"}
let(:azure_storage_access_key) {"testKey1"}
subject {Azure::Storage.client(storage_account_name: azure_storage_account, storage_access_key: azure_storage_access_key)}
subject {Azure::Storage::Client.create(storage_account_name: azure_storage_account, storage_access_key: azure_storage_access_key)}

it 'should create a blob client' do
subject.storage_account_name.must_equal azure_storage_account
Expand All @@ -45,4 +45,4 @@
subject.queueClient.host.must_equal "https://#{azure_storage_account}.queue.core.windows.net"
end
end
end
end
6 changes: 3 additions & 3 deletions test/unit/core/http_client_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
end

it 'should set the proxy configuration information on the http connection' do
Azure::Storage.client.agents(uri).proxy.uri.must_equal http_proxy_uri
Azure::Storage::Client.create().agents(uri).proxy.uri.must_equal http_proxy_uri
end
end

Expand All @@ -47,8 +47,8 @@
end

it 'should set the proxy configuration information on the https connection' do
Azure::Storage.client.agents(uri).proxy.uri.must_equal https_proxy_uri
Azure::Storage::Client.create().agents(uri).proxy.uri.must_equal https_proxy_uri
end
end
end
end
end

0 comments on commit 64fafba

Please sign in to comment.