Chef/Correctness/InvalidPlatformValueForPlatformHelper
The Cookstyle cops department: Chef/Correctness
| Enabled by default | Supports autocorrection | Target Chef Version |
|---|---|---|
| Enabled | No | All Versions |
Pass valid platforms to the value_for_platform helper. See Infra Language: Platform for a list of many common platform values.
Examples
incorrect
value_for_platform(
%w(rhel mac_os_x_server) => { 'default' => 'foo' },
%w(sles) => { 'default' => 'bar' }
)```
### correct
```ruby
value_for_platform(
%w(redhat mac_os_x) => { 'default' => 'foo' },
%w(opensuseleap) => { 'default' => 'bar' }
)
Configurable attributes
| Name | Default value | Configurable values |
|---|---|---|
| Version Added | 5.15.0 | String |
| Include | Array |