From 1dd1c490328d1842f56f748821c43a7b1bb0c7d7 Mon Sep 17 00:00:00 2001 From: Jonny An Date: Tue, 24 Apr 2018 17:07:32 -0700 Subject: [PATCH] Fix FC108: Resource should not define a property named 'name' Signed-off-by: Jonathan An --- README.md | 2 +- recipes/task.rb | 2 +- resources/scheduled_task.rb | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 291bd97c..c39496da 100644 --- a/README.md +++ b/README.md @@ -322,7 +322,7 @@ The chef_client_scheduled_task setups up chef-client to run as a scheduled task. - `log_directory` - The path to the Chef log directory. default: 'CONFIG_DIRECTORY/log' - `chef_binary_path` - The path to the chef-client binary. default: 'C:/opscode/chef/bin/chef-client' - `daemon_options` - An optional array of extra options to pass to the chef-client -- `name` - The name of the scheduled task. This allows for multiple chef_client_scheduled_task resources when it is used directly like in a wrapper cookbook. default: 'chef-client' +- `task_name` - The name of the scheduled task. This allows for multiple chef_client_scheduled_task resources when it is used directly like in a wrapper cookbook. default: 'chef-client' ## Maintainers diff --git a/recipes/task.rb b/recipes/task.rb index a892ffe3..824abe9c 100644 --- a/recipes/task.rb +++ b/recipes/task.rb @@ -46,5 +46,5 @@ class ::Chef::Recipe log_directory node['chef_client']['log_dir'] chef_binary_path node['chef_client']['bin'] daemon_options node['chef_client']['daemon_options'] - name node['chef_client']['task']['name'] + task_name node['chef_client']['task']['name'] end diff --git a/resources/scheduled_task.rb b/resources/scheduled_task.rb index 8cf56e35..fce86421 100644 --- a/resources/scheduled_task.rb +++ b/resources/scheduled_task.rb @@ -30,7 +30,7 @@ property :log_directory, String, default: lazy { |r| "#{r.config_directory}/log" } property :chef_binary_path, String, default: 'C:/opscode/chef/bin/chef-client' property :daemon_options, Array, default: [] -property :name, String, default: 'chef-client' +property :task_name, String, default: 'chef-client' action :add do create_chef_directories @@ -52,7 +52,7 @@ "cmd /c \'#{client_cmd}\'" end - windows_task new_resource.name do + windows_task new_resource.task_name do run_level :highest command full_command user new_resource.user @@ -65,7 +65,7 @@ end action :remove do - windows_task new_resource.name do + windows_task new_resource.task_name do action :delete end end