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

Add support for Softlayer cloud #448

Merged
merged 5 commits into from Aug 14, 2015
Merged

Add support for Softlayer cloud #448

merged 5 commits into from Aug 14, 2015

Conversation

akarpik
Copy link

@akarpik akarpik commented Dec 19, 2014

Add support for Softlayer cloud

# true:: If the softlayer cloud can be identified
# false:: Otherwise
def looks_like_softlayer?
!!hint?('softlayer')

Choose a reason for hiding this comment

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

I'm a little confused on the need for a !!. Looking through the hints code I see that it will either return a hash or nil(which will evaluate to false). Can you just use hint?('softlayer')

Also it would be great to leverage the mixin for softlayer in order to see if you can hit the api url. Then looks_like_softlayer? can be expanded to
hint?('softlayer') || has_softlayer_metadata?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, I'm not sure why this is really necessary.

'instance_id' => fetch_metadata_item("getId.txt")
}

metadata
Copy link
Contributor

Choose a reason for hiding this comment

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

this line is useless in ruby.

@smurawski
Copy link
Contributor

This might need a rebase due to some other previous updates to master.

@cmluciano
Copy link

ping @akarpik can you rebase and resubmit?

@@ -11,7 +11,7 @@ gem "rspec_junit_formatter", :git => 'https://github.com/sj26/rspec_junit_format
group :development do
gem "chef", github: "opscode/chef", branch: "master"

gem "sigar", :platform => "ruby"
# gem "sigar", :platform => "ruby"
Copy link
Contributor

Choose a reason for hiding this comment

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

looks like something edited out in testing that should be dropped?

@lamont-granquist
Copy link
Contributor

@chef/client-core @chef/client-engineers i sorta feel strongly that this is still incorrect behavior with the empty hash for softlayer attrs if the metadata service returns an error. the kinds of conditions that i'm worried about are now we don't get our ip addresses in the metadata and the chef run continues successfully and then the node is posted and now searches for the node will not have the ip address. it would be better to allow the error here. it would be even better to be able to abort ohai and abort the wrapping chef run completely.

need some more thoughts on resolving this.

@danielsdeleo
Copy link
Contributor

I think for now it should be consistent with what the other plugins do. With Ohai 7 we wanted to implement better behavior for error handling (read: don't just swallow failures) and also some way of failing the chef run if certain attributes didn't get set in ohai, but ran out of time. We're a lot closer with the Ohai 7 architecture though.

@jonlives
Copy link

👍 for consistency, as long as it's something that does eventually get fixed

@smurawski
Copy link
Contributor

@akarpik We understand the use case for wanting to leave the softlayer node as a hint, but that is not the behavior of existing plugins and the direction we want to go with Ohai includes adding support to bubble up errors and deal with them in a consistent manner. This would add an exception to the current use case and probably break moving forward.

If you remove that behavior, we can merge in the additional softlayer metadata changes, otherwise we'll have to close the PR.

@akarpik
Copy link
Author

akarpik commented Mar 19, 2015

@smurawski, I will remove behaviour, and update tests.

@smurawski
Copy link
Contributor

@akarpik Thank you! Looking forward to getting your softlayer support merged!

@cmluciano
Copy link

how's this looking now @smurawski

@thommay
Copy link
Contributor

thommay commented Aug 14, 2015

👍 when this is merged we'll need to be careful about the changelog.

@thommay
Copy link
Contributor

thommay commented Aug 14, 2015

cc @chef/client-core for one more review.

@lamont-granquist
Copy link
Contributor

👍

thommay added a commit that referenced this pull request Aug 14, 2015
@thommay thommay merged commit d756a5d into chef:master Aug 14, 2015
@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.

None yet

9 participants