summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-04-24 13:50:53 -0700
committerTim Smith <tsmith84@gmail.com>2020-04-24 13:52:26 -0700
commit75d61cbf8faacd1e303f50cf136ea1cbb1ac7de4 (patch)
treea2f4cabdb9cfaf8a2d366f36d749c308a114203a
parent3a5c7693b2eb7964c81c400fa3cb9c98974f7ba6 (diff)
downloadchef-75d61cbf8faacd1e303f50cf136ea1cbb1ac7de4.tar.gz
Move the windows only timeout property from service to windows_service
Also give it a real default. This improves our automatic documentation generation. Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--lib/chef/provider/service/windows.rb4
-rw-r--r--lib/chef/resource/service.rb5
-rw-r--r--lib/chef/resource/windows_service.rb5
3 files changed, 6 insertions, 8 deletions
diff --git a/lib/chef/provider/service/windows.rb b/lib/chef/provider/service/windows.rb
index 63cc5fd26c..9a7f5fa1d8 100644
--- a/lib/chef/provider/service/windows.rb
+++ b/lib/chef/provider/service/windows.rb
@@ -47,8 +47,6 @@ class Chef::Provider::Service::Windows < Chef::Provider::Service
START_PENDING = "start pending".freeze
STOP_PENDING = "stop pending".freeze
- TIMEOUT = 60
-
SERVICE_RIGHT = "SeServiceLogonRight".freeze
def load_current_resource
@@ -336,7 +334,7 @@ class Chef::Provider::Service::Windows < Chef::Provider::Service
end
def resource_timeout
- @resource_timeout ||= @new_resource.timeout || TIMEOUT
+ @resource_timeout ||= @new_resource.timeout
end
def spawn_command_thread
diff --git a/lib/chef/resource/service.rb b/lib/chef/resource/service.rb
index 50a7dda437..b28ba365b2 100644
--- a/lib/chef/resource/service.rb
+++ b/lib/chef/resource/service.rb
@@ -114,11 +114,6 @@ class Chef
property :priority, [ Integer, String, Hash ],
description: "Debian platform only. The relative priority of the program for start and shutdown ordering. May be an integer or a Hash. An integer is used to define the start run levels; stop run levels are then 100-integer. A Hash is used to define values for specific run levels. For example, { 2 => [:start, 20], 3 => [:stop, 55] } will set a priority of twenty for run level two and a priority of fifty-five for run level three."
- # timeout only applies to the windows service manager
- property :timeout, Integer,
- description: "Microsoft Windows platform only. The amount of time (in seconds) to wait before timing out.",
- desired_state: false
-
property :parameters, Hash,
description: "Upstart only: A hash of parameters to pass to the service command for use in the service definition."
diff --git a/lib/chef/resource/windows_service.rb b/lib/chef/resource/windows_service.rb
index 9d61990605..34f3cfb9a7 100644
--- a/lib/chef/resource/windows_service.rb
+++ b/lib/chef/resource/windows_service.rb
@@ -41,6 +41,11 @@ class Chef
allowed_actions :configure_startup, :create, :delete, :configure
+ property :timeout, Integer,
+ description: "The amount of time (in seconds) to wait before timing out.",
+ default: 60,
+ desired_state: false
+
# The display name to be used by user interface programs to identify the
# service. This string has a maximum length of 256 characters.
property :display_name, String, regex: /^.{1,256}$/,