Skip to content

Commit 4af5674

Browse files
jaymzhmeta-codesync[bot]
authored andcommitted
Fix ChefUtils migration PR
Summary: It turns out there's a far cleaner way to do this migration. We can reference ChefUtils.<function> directly from anywhere. So, convert the only two callers in the codebase. Cannot yet remove the proxy since callers are not all in the same cookbook and cookbook uploads are not atomic. Next PR will remove the class. Then I'll update my other PRs. I tested this in Chef 16 and Chef 18, here's the 16 version for reference: ``` [2026-06-02T14:23:36-07:00] INFO: *** Cinc Client 16.18.0 *** CU-TEST:ATTRIBUTES ChefUtils.rhel? false [fb_helpers:rhel_family] rhel? false [fb_helpers:rhel_family] node.rhel? false CU-TEST:RECIPE ChefUtils.rhel? false rhel? false [fb_helpers:rhel_family] node.rhel? false ChefUtils.windows? false windows? false [fb_helpers:windows] node.windows? false ChefUtils.debian? true debian? true [fb_helpers:debian] node.debian? true CU-TEST:LIBRARY ChefUtils.rhel? false rhel? false [fb_helpers:rhel_family] node.rhel? false ChefUtils.windows? false windows? false [fb_helpers:windows] node.windows? false ChefUtils.debian? true debian? true [fb_helpers:debian] node.debian? true CU-TEST:FB_HELPERS_NODE_LIBRARY ChefUtils.rhel? false [fb_helpers:rhel_family] rhel? false [fb_helpers:rhel_family] node.rhel? false ChefUtils.windows? false [fb_helpers:windows] windows? false [fb_helpers:windows] node.windows? false ChefUtils.debian? true [fb_helpers:debian] debian? true [fb_helpers:debian] node.debian? true CU-TEST:TEMPLATE ChefUtils.rhel? false rhel? <cannot be called from a template> [fb_helpers:rhel_family] node.rhel? false ChefUtils.windows? false windows? <cannot be called from a template> [fb_helpers:windows] node.windows? false ChefUtils.debian? true debian? <cannot be called from a template> [fb_helpers:debian] node.windows? true ``` Signed-off-by: Phil Dibowitz <phil@ipom.com> X-link: facebook/chef-cookbooks#376 Reviewed By: dafyddcrosby Differential Revision: D107317380 Pulled By: davide125 fbshipit-source-id: 9195316c9e29d9b5064cca436e8ac0777a567098
1 parent 1308537 commit 4af5674

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

itchef/cookbooks/fb_helpers/libraries/node_methods.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1346,15 +1346,15 @@ def selinux_enabled?
13461346
end
13471347

13481348
def host_chef_base_path
1349-
if self.chefutils.windows?
1349+
if ChefUtils.windows?
13501350
File.join('C:', 'chef')
13511351
else
13521352
File.join('/var', 'chef')
13531353
end
13541354
end
13551355

13561356
def solo_chef_base_path
1357-
if self.chefutils.windows?
1357+
if ChefUtils.windows?
13581358
File.join('C:', 'chef', 'solo')
13591359
else
13601360
File.join('/opt', 'chef-solo')

0 commit comments

Comments
 (0)