Class: Chef::Provider::ChefEnvironment
- Inherits:
-
Cheffish::ChefProviderBase
- Object
- Cheffish::ChefProviderBase
- Chef::Provider::ChefEnvironment
- Defined in:
- lib/chef/provider/chef_environment.rb
Instance Method Summary collapse
- #augment_new_json(json) ⇒ Object
- #data_handler ⇒ Object
- #keys ⇒ Object
- #load_current_resource ⇒ Object
-
#resource_class ⇒ Object
Helpers.
- #whyrun_supported? ⇒ Boolean
Instance Method Details
#augment_new_json(json) ⇒ Object
49 50 51 52 53 54 |
# File 'lib/chef/provider/chef_environment.rb', line 49 def augment_new_json(json) # Apply modifiers json['default_attributes'] = apply_modifiers(new_resource.default_attribute_modifiers, json['default_attributes']) json['override_attributes'] = apply_modifiers(new_resource.override_attribute_modifiers, json['override_attributes']) json end |
#data_handler ⇒ Object
64 65 66 |
# File 'lib/chef/provider/chef_environment.rb', line 64 def data_handler Chef::ChefFS::DataHandler::EnvironmentDataHandler.new end |
#keys ⇒ Object
68 69 70 71 72 73 74 75 76 |
# File 'lib/chef/provider/chef_environment.rb', line 68 def keys { 'name' => :name, 'description' => :description, 'cookbook_versions' => :cookbook_versions, 'default_attributes' => :default_attributes, 'override_attributes' => :override_attributes } end |
#load_current_resource ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/chef/provider/chef_environment.rb', line 37 def load_current_resource begin @current_resource = json_to_resource(rest.get("environments/#{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
Helpers
60 61 62 |
# File 'lib/chef/provider/chef_environment.rb', line 60 def resource_class Chef::Resource::ChefEnvironment end |
#whyrun_supported? ⇒ Boolean
7 8 9 |
# File 'lib/chef/provider/chef_environment.rb', line 7 def whyrun_supported? true end |