Sha256: c4799af63c5b55d9aaf3e5a0fe132e1f0c08cbdc43f6342b562e42ce9fb7da59

Contents?: true

Size: 1.1 KB

Versions: 78

Compression:

Stored size: 1.1 KB

Contents

require 'chef/chef_fs/data_handler/data_handler_base'
require 'chef/role'

class Chef
  module ChefFS
    module DataHandler
      class RoleDataHandler < DataHandlerBase
        def normalize(role, entry)
          result = normalize_hash(role, {
            'name' => remove_dot_json(entry.name),
            'description' => '',
            'json_class' => 'Chef::Role',
            'chef_type' => 'role',
            'default_attributes' => {},
            'override_attributes' => {},
            'run_list' => [],
            'env_run_lists' => {}
          })
          result['run_list'] = normalize_run_list(result['run_list'])
          result['env_run_lists'].each_pair do |env, run_list|
            result['env_run_lists'][env] = normalize_run_list(run_list)
          end
          result
        end

        def preserve_key(key)
          return key == 'name'
        end

        def chef_class
          Chef::Role
        end

        def to_ruby(object)
          to_ruby_keys(object, %w(name description default_attributes override_attributes run_list env_run_lists))
        end
      end
    end
  end
end

Version data entries

78 entries across 78 versions & 1 rubygems

Version Path
chef-11.18.12-x86-mingw32 lib/chef/chef_fs/data_handler/role_data_handler.rb
chef-11.18.12 lib/chef/chef_fs/data_handler/role_data_handler.rb
chef-11.18.6-x86-mingw32 lib/chef/chef_fs/data_handler/role_data_handler.rb
chef-11.18.6 lib/chef/chef_fs/data_handler/role_data_handler.rb
chef-11.18.0-x86-mingw32 lib/chef/chef_fs/data_handler/role_data_handler.rb
chef-11.18.0 lib/chef/chef_fs/data_handler/role_data_handler.rb
chef-11.16.4-x86-mingw32 lib/chef/chef_fs/data_handler/role_data_handler.rb
chef-11.16.4 lib/chef/chef_fs/data_handler/role_data_handler.rb
chef-11.16.2-x86-mingw32 lib/chef/chef_fs/data_handler/role_data_handler.rb
chef-11.16.2 lib/chef/chef_fs/data_handler/role_data_handler.rb
chef-11.16.0-x86-mingw32 lib/chef/chef_fs/data_handler/role_data_handler.rb
chef-11.16.0 lib/chef/chef_fs/data_handler/role_data_handler.rb
chef-11.16.0.rc.0 lib/chef/chef_fs/data_handler/role_data_handler.rb
chef-12.0.0.alpha.1-x86-mingw32 lib/chef/chef_fs/data_handler/role_data_handler.rb
chef-12.0.0.alpha.1 lib/chef/chef_fs/data_handler/role_data_handler.rb
chef-11.14.6-x86-mingw32 lib/chef/chef_fs/data_handler/role_data_handler.rb
chef-11.14.6 lib/chef/chef_fs/data_handler/role_data_handler.rb
chef-11.14.2-x86-mingw32 lib/chef/chef_fs/data_handler/role_data_handler.rb
chef-11.14.2 lib/chef/chef_fs/data_handler/role_data_handler.rb
chef-12.0.0.alpha.0-x86-mingw32 lib/chef/chef_fs/data_handler/role_data_handler.rb