Class: Chef::Provider::ChefContainer

Inherits:
Cheffish::ChefProviderBase show all
Defined in:
lib/chef/provider/chef_container.rb

Instance Method Summary collapse

Methods inherited from Cheffish::ChefProviderBase

#apply_modifiers, #apply_run_list_modifiers, #augment_current_json, #augment_new_json, #current_json, #current_resource_exists?, #json_differences, #json_differences_internal, #json_to_resource, #normalize, #normalize_for_post, #normalize_for_put, #not_found_resource, #resource_to_json, #rest, #same_run_list_item

Instance Method Details

#data_handlerObject



46
47
48
# File 'lib/chef/provider/chef_container.rb', line 46

def data_handler
  Chef::ChefFS::DataHandler::ContainerDataHandler.new
end

#keysObject



50
51
52
# File 'lib/chef/provider/chef_container.rb', line 50

def keys
  { 'containername' => :name, 'containerpath' => :name }
end

#load_current_resourceObject



30
31
32
33
34
35
36
37
38
39
40
# File 'lib/chef/provider/chef_container.rb', line 30

def load_current_resource
  begin
    @current_exists = rest.get("containers/#{new_resource.name}")
  rescue Net::HTTPServerException => e
    if e.response.code == "404"
      @current_exists = false
    else
      raise
    end
  end
end

#new_jsonObject



42
43
44
# File 'lib/chef/provider/chef_container.rb', line 42

def new_json
  {}
end

#whyrun_supported?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/chef/provider/chef_container.rb', line 10

def whyrun_supported?
  true
end