-
Notifications
You must be signed in to change notification settings - Fork 80
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
Updated so that the credentials file is only interogated if it exists #42
Conversation
Fixes #39 Signed-off-by: Russell Seymour <russell.seymour@turtlesystems.co.uk>
Fixes issue when only using environment variables /cc @adamleff @chris-rock |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like a reasonable change to me!
My only suggestion: when a variable (like @credentials
) contains contents, I tend to like to set the variable to nil
instead of false
if the file doesn't exist or can't be read. Then down around like 60, it would say unless @credentials.nil?
rather than if @credentials
. Perhaps it's personal preference, but I think it's clearer.
Alternatively, and mostly because I like to break things up into small methods to make testing easier, I would consider creating a method credentials_file_exists?
and using that in lines 29 and line 60 instead.
But this is totally fine as-is as far as I'm concerned. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to see the improvement mentioned by @adamleff implemented, since we assign false to a variable that holds the content of the ini file. Therefore we really should just check for nil.
the pull request #40 and this one are a duplicate, both are trying to fix the same issue. Could you please advice the way to go? If we decide to go with this implementation I'll delete the fix included into the pull request mentioned. Please let me know, thanks. |
Signed-off-by: Russell Seymour <russell.seymour@turtlesystems.co.uk>
I have modified the I have not added tge method Sorry for the delay in sorting this, I need to get my GitHub alerts sorted. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @russellseymour
Guy's, I am facing related issue after recent changes in repo. I am a tester and using this repo to write tests for checking Azure VM's hosted in our Infra. https://github.com/chef/inspec-azure/issues/58 What am I doing wrong here ? |
Fixes #39
Signed-off-by: Russell Seymour russell.seymour@turtlesystems.co.uk