File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,11 +13,22 @@ class LinuxUpdateManager < Inspec.resource(1)
1313 name 'linux_update'
1414 desc 'Use the linux_update InSpec audit resource to test for available or installed updates'
1515
16+ # def initialize
17+ # if inspec.os.redhat?
18+ # @update_mgmt = RHELUpdateFetcher.new(inspec)
19+ # elsif inspec.os.debian?
20+ # @update_mgmt = UbuntuUpdateFetcher.new(inspec)
21+ # end
22+ # return skip_resource 'The `linux_update` resource is not supported on your OS.' if @update_mgmt.nil?
23+ # end
24+
25+ # Since Amazon Linux is based on RedHat, they may use the same method.
1626 def initialize
17- if inspec . os . redhat?
18- @update_mgmt = RHELUpdateFetcher . new ( inspec )
19- elsif inspec . os . debian?
20- @update_mgmt = UbuntuUpdateFetcher . new ( inspec )
27+ case inspec . os [ :family ]
28+ when 'redhat' , 'amazon'
29+ @update_mgmt = RHELUpdateFetcher . new ( inspec )
30+ when 'debian'
31+ @update_mgmt = UbuntuUpdateFetcher . new ( inspec )
2132 end
2233 return skip_resource 'The `linux_update` resource is not supported on your OS.' if @update_mgmt . nil?
2334 end
You can’t perform that action at this time.
0 commit comments