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

Remove rubygems / Internet wmi-lite dependency #108

Merged
merged 4 commits into from
Aug 13, 2014

Conversation

adamedx
Copy link
Contributor

@adamedx adamedx commented Aug 7, 2014

An earlier change replaced the now unsatisfied gem dependency (as of Chef 11.14.2) rdp-ruby-wmi with a runtime gem download dependency of wmi-lite from RubyGems. This causes problems for use cases where chef-client needs to run without access to the Internet.

This change simply uses WIN32OLE which is part of the standard Ruby distribution to access WMI (which wmi-lite wraps lightly). This has been tested with the registry_helper and versions libraries and verified.

# See the License for the specific language governing permissions and
# limitations under the License.
#

Copy link
Contributor

Choose a reason for hiding this comment

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

Don't you need to require'win32ole' here?

Copy link
Contributor

Choose a reason for hiding this comment

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

or require 'win32ole' if RUBY_PLATFORM =~ /mswin|mingw32|windows/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, probably just getting lucky that Chef already included it somewhere.

@jaym
Copy link
Contributor

jaym commented Aug 7, 2014

looks good

@btm
Copy link
Contributor

btm commented Aug 7, 2014

is this just wmi-lite-lite? Is this better in the long run than deciding to use ruby-wmi or wmi-lite depending on what's already available because of chef omnibus?

@adamedx
Copy link
Contributor Author

adamedx commented Aug 7, 2014

Good question @btm. The reason we have wmi-lite was to avoid duplicate code in Ohai and Chef, which both interface with WMI. This is fine because they both live in the world of RubyGems dependency management, even when it comes to omnibus. In the case of cookbooks, reliance on RubyGems for dependencies at runtime is not a standard pattern, and since there's an even 'wmi-liter' way to do this for the cookbooks in question, we can go that route.

@btm
Copy link
Contributor

btm commented Aug 7, 2014

Maybe it's too little code to care about long term. I hope we can find some time to RFC and implement a way to specify cookbook runtime dependencies like gem installation as was previously discussed on the last PR: #101 (comment)

btm added a commit that referenced this pull request Aug 13, 2014
…s-dependency

Remove rubygems / Internet wmi-lite dependency
@btm btm merged commit 467a1d2 into master Aug 13, 2014
@btm btm deleted the adamedx/remove-rubygems-dependency branch August 13, 2014 01:03
@btm
Copy link
Contributor

btm commented Aug 13, 2014

Released in v1.34.2

@btm btm mentioned this pull request Aug 13, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants