-
-
Notifications
You must be signed in to change notification settings - Fork 107
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
Guard against :absent provider.options in redhat (issue 115) #140
Conversation
For what it's worth, I am not quite happy with having converted |
@@ -181,7 +181,7 @@ def self.format_file(filename, providers) | |||
props = {} | |||
|
|||
# Map everything to a flat hash | |||
props = (provider.options || {}) | |||
props = provider.options if provider.options and provider.options != :absent |
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.
https://travis-ci.org/voxpupuli/puppet-network/jobs/115005624#L369
rubocop says: Use && instead of and.
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.
whoops, didn't see that among all the other errors for that build
@@ -181,7 +181,7 @@ def self.format_file(filename, providers) | |||
props = {} | |||
|
|||
# Map everything to a flat hash |
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.
is the comment above still correct?
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 think so, yes, but it seems to refer to the block below the assignment to props. I'll just move it if that's the case
Sometimes provider.options ends up with the value of :absent, causing a failure. The debian provider (interfaces.rb) already guards against trying to manipulate :absent as a hash. Make the redhat provider also guard against this. This should fix issue 115.
Guard against :absent provider.options in redhat (issue 115)
thank you @rski! |
Sometimes
provider.options
ends up with the value of:absent
, causinga failure. The debian provider (interfaces.rb) already guards against
trying to manipulate
:absent
as a hash. Make the redhat provider alsoguard against this. This should fix issue 115.