In Chef, the Win32/registry class that's native to Ruby does some rude things with encoding that we monkeypatched for. That patch has worked great for a number of years. We recently took an update here for Ohai to overcome and issue FQDN's not displaying correctly for Windows nodes. PR #1816
The new code relies on the Resolv class to update node networking details. The unintended side effect of using the Resolv class is that it unilaterally re-installs the Win32/Registry class which essentially overwrites the monkey patch. Here we apply it to Ohai too.
This code be a breaking change since registry keys were previously retrieved with UTF16-LE encoding and will now be retrieved with UTF-8 encoding.
Related Issue
Types of changes
[ ] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
[ ] Chore (non-breaking change that does not add functionality or fix an issue)
Checklist:
[ ] I have read the CONTRIBUTING document.
[ ] I have run the pre-merge tests locally and they pass.
[ ] I have updated the documentation accordingly.
[ ] I have added tests to cover my changes.
[ ] If Gemfile.lock has changed, I have used --conservative to do it and included the full output in the Description above.
Description
In Chef, the Win32/registry class that's native to Ruby does some rude things with encoding that we monkeypatched for. That patch has worked great for a number of years. We recently took an update here for Ohai to overcome and issue FQDN's not displaying correctly for Windows nodes. PR #1816
The new code relies on the Resolv class to update node networking details. The unintended side effect of using the Resolv class is that it unilaterally re-installs the Win32/Registry class which essentially overwrites the monkey patch. Here we apply it to Ohai too.
This code be a breaking change since registry keys were previously retrieved with UTF16-LE encoding and will now be retrieved with UTF-8 encoding.
Related Issue
Types of changes
Checklist:
Gemfile.lock
has changed, I have used--conservative
to do it and included the full output in the Description above.