-
Notifications
You must be signed in to change notification settings - Fork 270
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
Conversation
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
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.
Don't you need to require'win32ole' here?
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.
or require 'win32ole' if RUBY_PLATFORM =~ /mswin|mingw32|windows/
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.
Good point, probably just getting lucky that Chef already included it somewhere.
looks good |
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? |
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. |
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) |
…s-dependency Remove rubygems / Internet wmi-lite dependency
Released in v1.34.2 |
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.