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

Fail Ohai when > 1 collect_data blocks defined per platform #217

Merged
merged 5 commits into from
Oct 30, 2013
Merged

Conversation

mcquin
Copy link
Contributor

@mcquin mcquin commented Oct 18, 2013

@mcquin
Copy link
Contributor Author

mcquin commented Oct 18, 2013

Not sure if I should find/create a more specific exception to raise than Exception

@mcquin mcquin closed this Oct 18, 2013
@mcquin mcquin reopened this Oct 18, 2013
@sersut
Copy link

sersut commented Oct 18, 2013

@mcquin I would vote to create a new exception class MissingCollectDataBlock to raise here.

Also we have other specific exceptions we are raising. Like the ones in:

https://github.com/opscode/ohai/blob/master/lib/ohai/runner.rb#L23-L27

We can move these classes to "lib/ohai/exception.rb" similar to the way done in:

https://github.com/opscode/chef/blob/master/lib/chef/exceptions.rb

@sersut
Copy link

sersut commented Oct 18, 2013

Also one q. Where are we handling the global exception handling so that OHAI will not stop if a plugin fails and throws an exception?

LMK if this question doesn't make sense :)

end
EOF
IO.stub(:read).with(@path).and_return(contents)
Ohai::Log.should_receive(:warn).with(/is not properly defined/)
Copy link

Choose a reason for hiding this comment

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

I think checking for the detailed error message here would be better. Error messages we provide should be as specific as possible so that people can debug their things.

Ohai::Log.should_receive(:warn).with(/collect_data already defined on platform/)

@sersut
Copy link

sersut commented Oct 24, 2013

Other than one minor comment looking awesome..

👍

@mcquin
Copy link
Contributor Author

mcquin commented Oct 30, 2013

@sersut good to merge?

@sersut
Copy link

sersut commented Oct 30, 2013

👍 Looks great :)

mcquin pushed a commit that referenced this pull request Oct 30, 2013
Fail Ohai when > 1 collect_data blocks defined per platform
@mcquin mcquin merged commit a436cd2 into master Oct 30, 2013
@mcquin mcquin deleted the OC-10247 branch October 30, 2013 19:44
@chef chef locked and limited conversation to collaborators Nov 16, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants