Support credentials file with multiple sections

Signed-off-by: Stuart Preston <stuart@chef.io>
This commit is contained in:
Stuart Preston 2017-01-24 13:22:01 +00:00
parent 5a52dfe3f9
commit 002aa73e7d

View file

@ -26,8 +26,8 @@ class AzureConnection
# If a connection already exists then return it # If a connection already exists then return it
return @conn if defined?(@conn) return @conn if defined?(@conn)
# Determine if only one subscription is specified in the configuration file, if so use that # Determine if more than one subscription is specified in the configuration file, if so use the first one
if @credentials.sections.length == 1 if @credentials.sections.length >= 1
@subscription_id = @credentials.sections[0] @subscription_id = @credentials.sections[0]
else else
@subscription_id = ENV['AZURE_SUBSCRIPTION_ID'] @subscription_id = ENV['AZURE_SUBSCRIPTION_ID']