Sha256: 61099a0f1660663ef80837770c6b7090a65fab67f1e68805311e38c628fd618f

Contents?: true

Size: 1 KB

Versions: 196

Compression:

Stored size: 1 KB

Contents

require_relative "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_data [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

196 entries across 196 versions & 1 rubygems

Version Path
chef-18.6.2-universal-mingw-ucrt lib/chef/chef_fs/data_handler/policy_group_data_handler.rb
chef-18.6.2 lib/chef/chef_fs/data_handler/policy_group_data_handler.rb
chef-17.10.163-universal-mingw32 lib/chef/chef_fs/data_handler/policy_group_data_handler.rb
chef-17.10.163 lib/chef/chef_fs/data_handler/policy_group_data_handler.rb
chef-18.5.0-x64-mingw-ucrt lib/chef/chef_fs/data_handler/policy_group_data_handler.rb
chef-18.5.0 lib/chef/chef_fs/data_handler/policy_group_data_handler.rb
chef-18.4.12-x64-mingw-ucrt lib/chef/chef_fs/data_handler/policy_group_data_handler.rb
chef-18.4.12 lib/chef/chef_fs/data_handler/policy_group_data_handler.rb
chef-17.10.122-universal-mingw32 lib/chef/chef_fs/data_handler/policy_group_data_handler.rb
chef-17.10.122 lib/chef/chef_fs/data_handler/policy_group_data_handler.rb
chef-17.10.114-universal-mingw32 lib/chef/chef_fs/data_handler/policy_group_data_handler.rb
chef-17.10.114 lib/chef/chef_fs/data_handler/policy_group_data_handler.rb
chef-18.4.2-x64-mingw-ucrt lib/chef/chef_fs/data_handler/policy_group_data_handler.rb
chef-18.4.2 lib/chef/chef_fs/data_handler/policy_group_data_handler.rb
chef-17.10.95-universal-mingw32 lib/chef/chef_fs/data_handler/policy_group_data_handler.rb
chef-17.10.95 lib/chef/chef_fs/data_handler/policy_group_data_handler.rb
chef-18.3.0-x64-mingw-ucrt lib/chef/chef_fs/data_handler/policy_group_data_handler.rb
chef-18.3.0 lib/chef/chef_fs/data_handler/policy_group_data_handler.rb
chef-17.10.68-universal-mingw32 lib/chef/chef_fs/data_handler/policy_group_data_handler.rb
chef-18.2.7-x64-mingw-ucrt lib/chef/chef_fs/data_handler/policy_group_data_handler.rb