Sha256: bc297bc734d44bb70639754c240c0f08954a864aaf260997568875d55195ef4d

Contents?: true

Size: 1.01 KB

Versions: 88

Compression:

Stored size: 1.01 KB

Contents

require "chef/chef_fs/data_handler/data_handler_base"

class Chef
  module ChefFS
    module DataHandler
      class PolicyGroupDataHandler < DataHandlerBase

        def normalize(policy_group, entry)
          defaults = {
            "name" => remove_dot_json(entry.name),
            "policies" => {},
          }
          result = normalize_hash(policy_group, defaults)
          result.delete("uri") # not useful data
          result
        end

        # Verify that the JSON hash for this type has a key that matches its name.
        #
        # @param object [Object] JSON hash of the object
        # @param entry [Chef::ChefFS::FileSystem::BaseFSObject] filesystem object we are verifying
        # @yield  [s] callback to handle errors
        # @yieldparam [s<string>] error message
        def verify_integrity(object_data, entry)
          if object_data["policies"].empty?
            yield("Policy group #{object_data["name"]} does not have any policies in it.")
          end
        end

      end
    end
  end
end

Version data entries

88 entries across 88 versions & 1 rubygems

Version Path
chef-13.12.14 lib/chef/chef_fs/data_handler/policy_group_data_handler.rb
chef-13.12.3 lib/chef/chef_fs/data_handler/policy_group_data_handler.rb
chef-13.11.3 lib/chef/chef_fs/data_handler/policy_group_data_handler.rb
chef-13.10.4 lib/chef/chef_fs/data_handler/policy_group_data_handler.rb
chef-13.10.0 lib/chef/chef_fs/data_handler/policy_group_data_handler.rb
chef-13.9.4 lib/chef/chef_fs/data_handler/policy_group_data_handler.rb
chef-12.22.5 lib/chef/chef_fs/data_handler/policy_group_data_handler.rb
chef-12.22.5-universal-mingw32 lib/chef/chef_fs/data_handler/policy_group_data_handler.rb
chef-13.9.1 lib/chef/chef_fs/data_handler/policy_group_data_handler.rb
chef-12.22.3 lib/chef/chef_fs/data_handler/policy_group_data_handler.rb
chef-12.22.3-universal-mingw32 lib/chef/chef_fs/data_handler/policy_group_data_handler.rb
chef-13.8.5 lib/chef/chef_fs/data_handler/policy_group_data_handler.rb
chef-13.8.3 lib/chef/chef_fs/data_handler/policy_group_data_handler.rb
chef-13.8.0 lib/chef/chef_fs/data_handler/policy_group_data_handler.rb
chef-13.7.16-universal-mingw32 lib/chef/chef_fs/data_handler/policy_group_data_handler.rb
chef-13.7.16 lib/chef/chef_fs/data_handler/policy_group_data_handler.rb
chef-12.21.31 lib/chef/chef_fs/data_handler/policy_group_data_handler.rb
chef-12.21.31-universal-mingw32 lib/chef/chef_fs/data_handler/policy_group_data_handler.rb
chef-13.6.4-universal-mingw32 lib/chef/chef_fs/data_handler/policy_group_data_handler.rb
chef-13.6.4 lib/chef/chef_fs/data_handler/policy_group_data_handler.rb