Class: Chef::Provider::ChefGroup
Instance Method Summary
collapse
#apply_modifiers, #apply_run_list_modifiers, #augment_current_json, #current_json, #current_resource_exists?, #json_differences, #json_differences_internal, #json_to_resource, #new_json, #normalize, #normalize_for_post, #normalize_for_put, #not_found_resource, #resource_to_json, #rest, #same_run_list_item
Instance Method Details
#augment_new_json(json) ⇒ Object
52
53
54
55
56
57
58
59
60
61
|
# File 'lib/chef/provider/chef_group.rb', line 52
def augment_new_json(json)
json['users'] |= new_resource.users
json['clients'] |= new_resource.clients
json['groups'] |= new_resource.groups
json['users'] -= new_resource.remove_users
json['clients'] -= new_resource.remove_clients
json['groups'] -= new_resource.remove_groups
json
end
|
#data_handler ⇒ Object
71
72
73
|
# File 'lib/chef/provider/chef_group.rb', line 71
def data_handler
Chef::ChefFS::DataHandler::GroupDataHandler.new
end
|
#keys ⇒ Object
75
76
77
78
79
80
|
# File 'lib/chef/provider/chef_group.rb', line 75
def keys
{
'name' => :name,
'groupname' => :name
}
end
|
#load_current_resource ⇒ Object
40
41
42
43
44
45
46
47
48
49
50
|
# File 'lib/chef/provider/chef_group.rb', line 40
def load_current_resource
begin
@current_resource = json_to_resource(rest.get("groups/#{new_resource.name}"))
rescue Net::HTTPServerException => e
if e.response.code == "404"
@current_resource = not_found_resource
else
raise
end
end
end
|
#resource_class ⇒ Object
67
68
69
|
# File 'lib/chef/provider/chef_group.rb', line 67
def resource_class
Chef::Resource::ChefGroup
end
|
#whyrun_supported? ⇒ Boolean
10
11
12
|
# File 'lib/chef/provider/chef_group.rb', line 10
def whyrun_supported?
true
end
|