diff options
author | Vasu1105 <vasundhara.jagdale@msystechnologies.com> | 2020-01-16 14:19:28 +0000 |
---|---|---|
committer | Vasu1105 <vasundhara.jagdale@msystechnologies.com> | 2020-01-16 14:19:28 +0000 |
commit | f6c781bca28e6ec27e71f7d78b88563b9ffb5306 (patch) | |
tree | cc7462ea57b5a91a8c872571e8ad21793a331c50 | |
parent | ee5d4142f7d9db19f42eaba023a826157c06ffcf (diff) | |
download | chef-f6c781bca28e6ec27e71f7d78b88563b9ffb5306.tar.gz |
Fix for windows task not idempotent on the windows19 and windows 16
Signed-off-by: Vasu1105 <vasundhara.jagdale@msystechnologies.com>
-rw-r--r-- | lib/chef/provider/windows_task.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/chef/provider/windows_task.rb b/lib/chef/provider/windows_task.rb index 93347027a5..4eae92b614 100644 --- a/lib/chef/provider/windows_task.rb +++ b/lib/chef/provider/windows_task.rb @@ -326,9 +326,10 @@ class Chef # known issue : Since start_day and time is not mandatory while updating weekly frequency for which start_day is not mentioned by user idempotency # is not gettting maintained as new_resource.start_day is nil and we fetch the day of week from start_day to set and its currently coming as nil and don't match with current_task def task_needs_update?(task) + flag = false if new_resource.frequency == :none - flag = (task.account_information != new_resource.user || + flag = (task.author != new_resource.user || task.application_name != new_resource.command || description_needs_update?(task) || task.parameters != new_resource.command_arguments.to_s || @@ -352,7 +353,7 @@ class Chef current_task_trigger[:type] != new_task_trigger[:type] || current_task_trigger[:random_minutes_interval].to_i != new_task_trigger[:random_minutes_interval].to_i || current_task_trigger[:minutes_interval].to_i != new_task_trigger[:minutes_interval].to_i || - task.account_information.to_s.casecmp(new_resource.user.to_s) != 0 || + task.author.to_s.casecmp(new_resource.user.to_s) != 0 || task.application_name != new_resource.command || description_needs_update?(task) || task.parameters != new_resource.command_arguments.to_s || |