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

Guard against :absent provider.options in redhat (issue 115) #140

Merged
merged 1 commit into from
Mar 10, 2016

Conversation

rski
Copy link
Member

@rski rski commented Mar 10, 2016

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.

@rski
Copy link
Member Author

rski commented Mar 10, 2016

For what it's worth, I am not quite happy with having converted || to if provider.options. If there is a better way to do this, I'd very much like to be told about it.

@@ -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
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member Author

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

@rski rski force-pushed the redhat_issue_115 branch from 2af423d to ced9953 Compare March 10, 2016 09:55
@@ -181,7 +181,7 @@ def self.format_file(filename, providers)
props = {}

# Map everything to a flat hash
Copy link
Contributor

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?

Copy link
Member Author

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.
@rski rski force-pushed the redhat_issue_115 branch from ced9953 to ad57f45 Compare March 10, 2016 10:42
igalic added a commit that referenced this pull request Mar 10, 2016
Guard against :absent provider.options in redhat (issue 115)
@igalic igalic merged commit 487bc6c into voxpupuli:master Mar 10, 2016
@igalic
Copy link
Contributor

igalic commented Mar 10, 2016

thank you @rski!

@rski rski deleted the redhat_issue_115 branch May 9, 2016 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants