Skip to content

Commit 05ce3ab

Browse files
jaymzhmeta-codesync[bot]
authored andcommitted
Remove the [unnused] chefutils proxy class
Summary: No longer needed. Signed-off-by: Phil Dibowitz <phil@ipom.com> X-link: facebook/chef-cookbooks#377 Reviewed By: dafyddcrosby Differential Revision: D107427478 Pulled By: davide125 fbshipit-source-id: d259778a9cccd1d223b2187a57194c443618cdd3
1 parent f3b2bc5 commit 05ce3ab

2 files changed

Lines changed: 0 additions & 49 deletions

File tree

itchef/cookbooks/fb_helpers/libraries/node_methods.rb

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,30 +19,10 @@
1919
# Reference: Chef platform_family values
2020
# https://docs.chef.io/infra_language/checking_platforms/#platform_family-values
2121

22-
class ChefUtilsProxy
23-
include ChefUtils
24-
25-
def initialize(node)
26-
@node = node
27-
end
28-
29-
def __getnode(_skip_global = false)
30-
@node
31-
end
32-
end
33-
3422
class Chef
3523
# Our extensions of the node object
3624
class Node
3725

38-
# A way to explicitly call a ChefUtils function instead of a
39-
# fb_helpers function to aid in migration
40-
def chefutils
41-
# rubocop:disable Naming/MemoizedInstanceVariableName
42-
@_fb_helpers_chefutils_proxy ||= ChefUtilsProxy.new(self)
43-
# rubocop:enable Naming/MemoizedInstanceVariableName
44-
end
45-
4626
def linux?
4727
return @_fb_helpers_linux unless @_fb_helpers_linux.nil?
4828
@_fb_helpers_linux = self['os'] == 'linux'

itchef/cookbooks/fb_helpers/spec/node_spec.rb

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -315,35 +315,6 @@
315315
end
316316
end
317317

318-
context 'Chef::Node.chefutils' do
319-
it 'returns true for debian? when platform_family is debian' do
320-
node.automatic['platform'] = 'debian'
321-
node.automatic['platform_family'] = 'debian'
322-
expect(node.chefutils.debian?).to be(true)
323-
end
324-
325-
it 'returns false for debian? when platform_family is not debian' do
326-
node.automatic['platform'] = 'centos'
327-
node.automatic['platform_family'] = 'rhel'
328-
expect(node.chefutils.debian?).to be(false)
329-
end
330-
331-
it 'differs from node.debian? for ubuntu (platform_family=debian, platform=ubuntu)' do
332-
node.automatic['platform'] = 'ubuntu'
333-
node.automatic['platform_family'] = 'debian'
334-
# fb_helpers checks platform == 'debian', so ubuntu is false
335-
expect(node.debian?).to be(false)
336-
# ChefUtils checks platform_family == 'debian', so ubuntu is true
337-
expect(node.chefutils.debian?).to be(true)
338-
end
339-
340-
it 'returns true for rhel? when platform_family is rhel' do
341-
node.automatic['platform'] = 'centos'
342-
node.automatic['platform_family'] = 'rhel'
343-
expect(node.chefutils.rhel?).to be(true)
344-
end
345-
end
346-
347318
context 'Chef::Node.disruptable?' do
348319
it 'is not disruptable by default' do
349320
expect(node.disruptable?).to be(false)

0 commit comments

Comments
 (0)