Skip to main content

HWRPWithoutUnifiedTrue

All Cookstyle Cops


The department is: Chef/Deprecations

The full name of the cop is: Chef/Deprecations/HWRPWithoutUnifiedTrue


Enabled by defaultSupports autocorrectionTarget Chef Version
EnabledNo15.3+

Chef Infra Client 15.3 and later include a new Unified Mode that simplies the execution of resoures by replace the traditional compile and converge phases with a single phase. Unified mode simplies writing advanced resources and avoids confusing errors that often occur when mixing ruby and Chef Infra resources. Chef Infra Client 17.0 and later will beging warning that unified_mode true should be set in all resources to validate that they will continue to function in Chef Infra Client 18.0 (April 2022) when Unified Mode becomes the default.

Examples

incorrect

 class Chef
   class Resource
     class UlimitRule < Chef::Resource
       provides :ulimit_rule

       property :type, [Symbol, String], required: true
       property :item, [Symbol, String], required: true

       # additional resource code
     end
   end
 end

correct

 class Chef
   class Resource
     class UlimitRule < Chef::Resource
       provides :ulimit_rule
       unified_mode true

       property :type, [Symbol, String], required: true
       property :item, [Symbol, String], required: true

       # additional resource code
     end
   end
 end

Configurable attributes

NameDefault valueConfigurable values
Version Added7.12.0String
Include
  • **/libraries/*.rb
Array

Was this page helpful?









Search Results