diff options
author | Bryan McLellan <btm@loftninjas.org> | 2018-05-17 13:17:53 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-17 13:17:53 -0400 |
commit | f5b5c9c156db41d5a0f323aad0763da2ceea38fb (patch) | |
tree | 0ffba51b6be9c1de226b30b1b30bf1ed2a17cc45 | |
parent | 985488397c1b8d4c1cab0a6a6613f17665311211 (diff) | |
parent | a6c3be3c9f19bfe242a99276a58e56d07e78e798 (diff) | |
download | chef-f5b5c9c156db41d5a0f323aad0763da2ceea38fb.tar.gz |
Merge pull request #7281 from MsysTechnologiesllc/vasundhara/Fix_for_windows_task_does_not_parse_backshlash_in_command_properly
[MSYS-817] fix for windows_task does not parse backslashes in the commad property
-rw-r--r-- | lib/chef/provider/windows_task.rb | 1 | ||||
-rw-r--r-- | spec/functional/resource/windows_task_spec.rb | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/lib/chef/provider/windows_task.rb b/lib/chef/provider/windows_task.rb index c9109d6996..0bb28c66c6 100644 --- a/lib/chef/provider/windows_task.rb +++ b/lib/chef/provider/windows_task.rb @@ -231,6 +231,7 @@ class Chef # seprated command arguments from :command property def set_command_and_arguments + new_resource.command = new_resource.command.gsub(/\\/, '\&\&') cmd, *args = Shellwords.split(new_resource.command) new_resource.command = cmd new_resource.command_arguments = args.join(" ") diff --git a/spec/functional/resource/windows_task_spec.rb b/spec/functional/resource/windows_task_spec.rb index d4a2bcc14e..65a396cf56 100644 --- a/spec/functional/resource/windows_task_spec.rb +++ b/spec/functional/resource/windows_task_spec.rb @@ -68,7 +68,7 @@ describe Chef::Resource::WindowsTask, :windows_only do current_resource = call_for_load_current_resource expect(current_resource.exists).to eq(true) expect(current_resource.task.application_name).to eq("chef-client") - expect(current_resource.task.parameters).to eq("-W -L C:\\chef\\chef-ad-join.log") + expect(current_resource.task.parameters).to eq("-W -L C:\\\\chef\\\\chef-ad-join.log") end it "does not converge the resource if it is already converged" do |