Skip to content

Commit

Permalink
Fix error due to missing method 'platform_family?'
Browse files Browse the repository at this point in the history
This PR fixes a compatibility issue with Chef 12.6.0 and below.
A Chef run exits with the following error message:
```No resource or method named `platform_family?' for `VaultCookbook::Provider::VaultService ""'```
  • Loading branch information
wndhydrnt committed Apr 4, 2017
1 parent afe7912 commit 3c8817a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libraries/vault_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ def action_enable
end

execute "setcap cap_ipc_lock=+ep #{new_resource.program}" do
not_if { platform_family?('windows', 'mac_os_x', 'freebsd') }
not_if { platform_family?('rhel') && node['platform_version'].to_i < 6 }
not_if { node.platform_family?('windows', 'mac_os_x', 'freebsd') }
not_if { node.platform_family?('rhel') && node['platform_version'].to_i < 6 }
not_if { new_resource.disable_mlock }
not_if "getcap #{new_resource.program}|grep cap_ipc_lock+ep"
end
Expand All @@ -97,7 +97,7 @@ def service_options(service)
service.options(:sysvinit, template: 'hashicorp-vault:sysvinit.service.erb')
service.options(:systemd, template: 'hashicorp-vault:systemd.service.erb')

if platform_family?('rhel') && node['platform_version'].to_i == 6
if node.platform_family?('rhel') && node['platform_version'].to_i == 6
service.provider(:sysvinit)
end
end
Expand Down

0 comments on commit 3c8817a

Please sign in to comment.