-
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
Switch to using the wmi-lite gem #101
Conversation
We'll need to modify this to ensure we have this before the libraries are loaded.
Thanks btm. Have just started using chef and ruby and my use case was very simple and don't think I actually hit the code I changed. |
@danielsdeleo , @btm, @sersut , @juliandunn, can you take a peek? Not sure if this is the best way to try to use chef_gem to satisfy a gem dependency in a library file. |
@@ -100,6 +100,7 @@ class Version | |||
0x00000030 => {:ms_const => 'PRODUCT_PROFESSIONAL', :name => 'Professional'}, | |||
0x00000045 => {:ms_const => 'PRODUCT_PROFESSIONAL_E', :name => 'Not supported'}, | |||
0x00000031 => {:ms_const => 'PRODUCT_PROFESSIONAL_N', :name => 'Professional N'}, | |||
0x00000067 => {:ms_const => 'PRODUCT_PROFESSIONAL_WMC', :name => 'Professional with Media Center'}, |
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.
So you're the only other person besides me @btm running Windows Media Center?
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.
It came free with my pro upgrade ¯_(ツ)_/¯
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.
FWIW, its a really nasty undefined method '[]' for nil:NilClass
error if your SKU isn't in the constant :(
The gem install stuff is ugly, but I don't know how to do it better without some support from Chef, which is something we've thought about but don't have a design for (and that wouldn't help immediate pain anyway). 👍 |
Thanks @btm, @danielsdeleo. Yeah, ideally you could express the gem dependencies in metadata.rb or even in a gemspec-like file. Then gems could be downloaded to a bundle for the cookbook when cookbooks are fetched. Crazy talk. |
Tested on 11.12.8, 11.14.2, and 10.32.2 successfully. |
Switch to using the wmi-lite gem
Chef switched from ruby-wmi to wmi-lite recently, have this cookbook do the same.
This replaces #100, and I'm handing this off to @Adamex to finish. I think the only work left is to think about making sure that wmi-lite is installed before the libraries need it if you're running on older versions of Chef that don't come with wmi-lite. Later we should deprecate the
windows/libraries/version.rb
in favor of `lib/chef/win32/version.rb' in chef.I've been testing with this recipe to make sure we exercise the libraries, as the default cookbook was happily running for me with just @pieter-lazzro's patch before I did so.
Resulting in: