Sha256: 77049740b0ba43aba23055cf4bcac1acd41cdac377bdbed2275e84bed5ac6a9b

Contents?: true

Size: 1.06 KB

Versions: 125

Compression:

Stored size: 1.06 KB

Contents

require_relative "data_handler_base"

class Chef
  module ChefFS
    module DataHandler
      class OrganizationDataHandler < DataHandlerBase
        def normalize(organization, entry)
          normalize_hash(organization, {
            "name" => entry.org,
            "full_name" => entry.org,
            "org_type" => "Business",
            "clientname" => "#{entry.org}-validator",
            "billing_plan" => "platform-free",
          })
        end

        def preserve_key?(key)
          key == "name"
        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, entry)
          if entry.org != object["name"]
            yield("Name must be '#{entry.org}' (is '#{object["name"]}')")
          end
        end
      end
    end
  end
end

Version data entries

125 entries across 125 versions & 1 rubygems

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