Module: Chef::Provider::InlineResources Private

Includes:
DSL::Recipe::FullDSL
Defined in:
lib/chef/provider.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Chef::Provider::InlineResources Implementation of inline resource convergence for providers. See Provider.use_inline_resources for a longer explanation.

This code is restricted to a module so that it can be selectively applied to providers on an opt-in basis.

Defined Under Namespace

Modules: ClassMethods

Constant Summary

Constants included from Mixin::ShellOut

Mixin::ShellOut::DEPRECATED_OPTIONS

Instance Method Summary collapse

Methods included from DSL::Powershell

#ps_credential

Methods included from DSL::Audit

#control_group

Methods included from DSL::RebootPending

#reboot_pending?

Methods included from DSL::PlatformIntrospection

#platform?, #platform_family?, #value_for_platform, #value_for_platform_family

Methods included from DSL::RegistryHelper

#registry_data_exists?, #registry_get_subkeys, #registry_get_values, #registry_has_subkeys?, #registry_key_exists?, #registry_value_exists?

Methods included from DSL::Recipe

#describe_self_for_error, #exec, #have_resource_class_for?, #method_missing, #resource_class_for

Methods included from DSL::DeclareResource

#build_resource, #declare_resource

Methods included from DSL::Definitions

add_definition, #evaluate_resource_definition, #has_resource_definition?

Methods included from DSL::Resources

add_resource_dsl, remove_resource_dsl

Methods included from DSL::ChefProvisioning

load_chef_provisioning

Methods included from DSL::Cheffish

load_cheffish

Methods included from Mixin::PowershellOut

#powershell_out, #powershell_out!

Methods included from Mixin::WindowsArchitectureHelper

#assert_valid_windows_architecture!, #disable_wow64_file_redirection, #forced_32bit_override_required?, #is_i386_process_on_x86_64_windows?, #node_supports_windows_architecture?, #node_windows_architecture, #restore_wow64_file_redirection, #valid_windows_architecture?, #with_os_architecture, #wow64_architecture_override_required?, #wow64_directory

Methods included from Mixin::ShellOut

#run_command_compatible_options, #shell_out, #shell_out!, #shell_out_with_systems_locale, #shell_out_with_systems_locale!

Methods included from DSL::IncludeRecipe

#include_recipe, #load_recipe, #require_recipe

Methods included from DSL::DataQuery

#data_bag, #data_bag_item, #search

Methods included from EncryptedDataBagItem::CheckEncrypted

#encrypted?

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Chef::DSL::Recipe

Instance Method Details

#compile_and_converge_action(&block) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Create a child run_context, compile the block, and converge it.



357
358
359
360
361
362
363
364
365
366
367
368
# File 'lib/chef/provider.rb', line 357

def compile_and_converge_action(&block)
  old_run_context = run_context
  @run_context = run_context.create_child
  return_value = instance_eval(&block)
  Chef::Runner.new(run_context).converge
  return_value
ensure
  if run_context.resource_collection.any? { |r| r.updated? }
    new_resource.updated_by_last_action(true)
  end
  @run_context = old_run_context
end