Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MSYS-817] fix for windows_task does not parse backslashes in the commad property #7281

Conversation

Vasu1105
Copy link

@Vasu1105 Vasu1105 commented May 17, 2018

Description

Fix for
The new windows_task in chef client v14 does not correctly parse backslashes in the command property- they end up being erased in the task on the node.

Issues Resolved

#7277

verified running with following recipes

windows_task 'chef-client-test' do
	task_name 'chef-client-test1'
	command 'chef-client -W -L "C:\\chef\\chef-ad-join.log"'
	user 'xxxxx'
	password 'xxxxx'
	run_level :highest
	frequency :daily
end

windows_task 'chef-client-test' do
	task_name 'chef-client-test2'
	command 'chef-client -W'
	run_level :highest
	frequency :daily
end

windows_task 'chef-client-test' do
	task_name 'chef-client-test3'
	command 'chef-client'
	run_level :highest
	frequency :daily
end

windows_task 'chef-client-test' do
	task_name 'chef-client-test4' 
	command '"C:\\Program Files\\Git\\git-bash.exe"'
	run_level :highest
	frequency :daily
end

windows_task 'chef-client-test' do
	task_name 'chef-client-test5' 
	command '"C:\Program Files\Git\git-bash.exe" -arg1 -arg2'
	run_level :highest
	frequency :daily
end

windows_task 'chef-client-test' do
	task_name 'chef-client-test6'
	command 'ping "http://www.google.com"'
	run_level :highest
	frequency :daily
end

windows_task 'test1' do
  cwd 'C:\\'
  command 'Powershell.exe -ExecutionPolicy Bypass C:\foo bar\bar\blah\script.ps1'
  run_level :highest
  frequency :daily
end

windows_task 'test2' do
  cwd 'C:\\'
  command 'Powershell.exe -ExecutionPolicy Bypass C:\\foo bar\\bar\\blah\\script.ps1'
  run_level :highest
  frequency :daily
end

windows_task 'test3' do
  cwd 'C:\\'
  command 'Powershell.exe -ExecutionPolicy Bypass C:\foo\bar\blah\script.ps1'
  run_level :highest
  frequency :daily
end


windows_task 'chef-client-test' do
	task_name 'chef-client-test7'
	command "chef-client -W -L 'C:\\chef\\chef-ad-join.log'"
	user 'xxxxx'
	password 'xxxxx'
	run_level :highest
	frequency :daily
end

Signed-off-by: vasu1105 vasundhara.jagdale@msystechnologies.com

…mand property

Signed-off-by: vasu1105 <vasundhara.jagdale@msystechnologies.com>
@Vasu1105 Vasu1105 requested review from a team, btm, stuartpreston and tas50 May 17, 2018 12:27
@btm btm merged commit f5b5c9c into chef:master May 17, 2018
@lock
Copy link

lock bot commented Jul 20, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jul 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants