Class: Chef::Provider::WindowsScript

Inherits:
Script show all
Includes:
Mixin::WindowsArchitectureHelper
Defined in:
lib/chef/provider/windows_script.rb

Direct Known Subclasses

Batch, PowershellScript

Constant Summary

Constants included from Mixin::ShellOut

Mixin::ShellOut::DEPRECATED_OPTIONS

Instance Attribute Summary

Attributes inherited from Chef::Provider

#action, #current_resource, #new_resource, #run_context

Instance Method Summary collapse

Methods included from Mixin::WindowsArchitectureHelper

#assert_valid_windows_architecture!, #disable_wow64_file_redirection, #is_i386_windows_process?, #node_supports_windows_architecture?, #node_windows_architecture, #restore_wow64_file_redirection, #valid_windows_architecture?, #wow64_architecture_override_required?

Methods inherited from Script

#flags, #interpreter, #set_owner_and_group, #unlink_script_file

Methods inherited from Execute

#load_current_resource, #whyrun_supported?

Methods included from Mixin::ShellOut

#run_command_compatible_options, #shell_out, #shell_out!

Methods inherited from Chef::Provider

#action_nothing, #cleanup_after_converge, #converge_by, #cookbook_name, #define_resource_requirements, #events, #load_current_resource, #node, #process_resource_requirements, #requirements, #resource_collection, #resource_updated?, #run_action, #set_updated_status, #whyrun_mode?, #whyrun_supported?

Methods included from DSL::Recipe

#method_missing

Methods included from Mixin::ConvertToClassName

#convert_to_class_name, #convert_to_snake_case, #filename_to_qualified_string, #snake_case_basename

Dynamic Method Handling

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

Instance Method Details

#action_runObject



47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/chef/provider/windows_script.rb', line 47

def action_run
  wow64_redirection_state = nil

  if @is_wow64
    wow64_redirection_state = disable_wow64_file_redirection(@run_context.node)
  end

  begin
    super
  rescue
    raise
  ensure
    if ! wow64_redirection_state.nil?
      restore_wow64_file_redirection(@run_context.node, wow64_redirection_state)
    end
  end
end

#script_fileObject



65
66
67
68
69
70
# File 'lib/chef/provider/windows_script.rb', line 65

def script_file
  base_script_name = "chef-script"
  temp_file_arguments = [ base_script_name, @script_extension ]

  @script_file ||= Tempfile.open(temp_file_arguments)
end