diff options
author | Jay Mundrawala <jdmundrawala@gmail.com> | 2015-02-12 15:52:09 -0600 |
---|---|---|
committer | Jay Mundrawala <jdmundrawala@gmail.com> | 2015-02-12 15:52:09 -0600 |
commit | fa1d868438058fa864caabb73568ef6d58ec8b7c (patch) | |
tree | 480cc266867c0510cd46851644735e79493c4c63 /lib/chef/provider | |
parent | e143d8d8b315e7025a605665b46c3c2293fd96eb (diff) | |
parent | 064d995d2e445034078e83e955f50bb2afa25bbc (diff) | |
download | chef-fa1d868438058fa864caabb73568ef6d58ec8b7c.tar.gz |
Merge pull request #2885 from chef/jdm/dsc_timeout
dsc_script passes timeout to lcm shellout
Diffstat (limited to 'lib/chef/provider')
-rw-r--r-- | lib/chef/provider/dsc_script.rb | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/chef/provider/dsc_script.rb b/lib/chef/provider/dsc_script.rb index d1f62d7f0d..c183f871e9 100644 --- a/lib/chef/provider/dsc_script.rb +++ b/lib/chef/provider/dsc_script.rb @@ -32,11 +32,11 @@ class Chef @dsc_resource = dsc_resource @resource_converged = false @operations = { - :set => Proc.new { |config_manager, document| - config_manager.set_configuration(document) + :set => Proc.new { |config_manager, document, shellout_flags| + config_manager.set_configuration(document, shellout_flags) }, - :test => Proc.new { |config_manager, document| - config_manager.test_configuration(document) + :test => Proc.new { |config_manager, document, shellout_flags| + config_manager.test_configuration(document, shellout_flags) }} end @@ -89,9 +89,15 @@ class Chef config_manager = Chef::Util::DSC::LocalConfigurationManager.new(@run_context.node, config_directory) + shellout_flags = { + :cwd => @dsc_resource.cwd, + :environment => @dsc_resource.environment, + :timeout => @dsc_resource.timeout + } + begin configuration_document = generate_configuration_document(config_directory, configuration_flags) - @operations[operation].call(config_manager, configuration_document) + @operations[operation].call(config_manager, configuration_document, shellout_flags) rescue Exception => e Chef::Log.error("DSC operation failed: #{e.message.to_s}") raise e |