Sha256: 534e95b29b4bb46fb08933926da43f1267563e00df4702a7f1eefecf05b25840

Contents?: true

Size: 813 Bytes

Versions: 2

Compression:

Stored size: 813 Bytes

Contents

require "chef/chef_fs/data_handler/data_handler_base"

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

        def preserve_key?(key)
          return key == "name"
        end

        def verify_integrity(object, entry, &on_error)
          if entry.org != object["name"]
            on_error.call("Name must be '#{entry.org}' (is '#{object['name']}')")
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
chef-12.7.2 lib/chef/chef_fs/data_handler/organization_data_handler.rb
chef-12.7.2-universal-mingw32 lib/chef/chef_fs/data_handler/organization_data_handler.rb