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

Fixes an issue where the credential file was nil #337

Merged
merged 1 commit into from
Aug 16, 2018

Conversation

dmccown
Copy link
Contributor

@dmccown dmccown commented Aug 15, 2018

This adds a test and a guard to handle the case where the credentials
file can be nil.

Signed-off-by: David McCown dmccown@chef.io

This adds a test and a guard to handle the case where the credentials
file can be nil.

Signed-off-by: David McCown <dmccown@chef.io>
@dmccown dmccown requested a review from jquick August 15, 2018 14:51
Copy link
Contributor

@jquick jquick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @dmccown

@@ -12,6 +12,7 @@ class FileCredentials
DEFAULT_FILE = ::File.join(Dir.home, '.azure', 'credentials')

def self.parse(subscription_id: nil, credentials_file: DEFAULT_FILE, **_)
credentials_file = DEFAULT_FILE if credentials_file.nil?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idiomatic ruby would have this as credentials_file ||= DEFAULT_FILE, but this should get you the same result.

@jquick jquick merged commit 445286d into inspec:master Aug 16, 2018
@clintoncwolfe clintoncwolfe added Transport/Azure Type: Bug Feature not working as expected and removed Transport: Azure labels Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform: Azure Type: Bug Feature not working as expected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants