Class: Chef::ChefFS::DataHandler::UserDataHandler

Inherits:
DataHandlerBase show all
Defined in:
lib/chef/chef_fs/data_handler/user_data_handler.rb

Instance Method Summary collapse

Methods inherited from DataHandlerBase

#chef_class, #chef_object, #default, #from_ruby, #minimize, #normalize_for_post, #normalize_for_put, #normalize_hash, #normalize_run_list, #remove_file_extension, #to_ruby, #to_ruby_keys, #verify_integrity

Instance Method Details

#normalize(user, entry) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/chef/chef_fs/data_handler/user_data_handler.rb', line 7

def normalize(user, entry)
  normalize_hash(user, {
    "name" => remove_dot_json(entry.name),
    "username" => remove_dot_json(entry.name),
    "display_name" => remove_dot_json(entry.name),
    "admin" => false,
    "json_class" => "Chef::WebUIUser",
    "chef_type" => "webui_user",
    "salt" => nil,
    "password" => nil,
    "openid" => nil,
  })
end

#preserve_key?(key) ⇒ Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/chef/chef_fs/data_handler/user_data_handler.rb', line 21

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