Skip to content

Commit 2163522

Browse files
committed
(PUP-11319) Move DEFAULT_TIMEOUT constant for Windows services
This commit moves the `DEFAULT_TIMEOUT` constant from `lib/puppet/util/windows/service.rb` to the provider directly (`lib/puppet/util/windows.rb`) to avoid `unitialized constant` errors when compiling catalogs on nonWindows OS.
1 parent 64ba729 commit 2163522

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

lib/puppet/util/windows.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ class Group < ADSIObject; end
99
module File; end
1010
module Registry
1111
end
12+
module Service
13+
DEFAULT_TIMEOUT = 30
14+
end
1215
module SID
1316
class Principal; end
1417
end

lib/puppet/util/windows/service.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@ module Service
1313

1414
FILE = Puppet::Util::Windows::File
1515

16-
# integer value of the floor for timeouts when waiting for service pending states.
17-
# puppet will wait the length of dwWaitHint if it is longer than this value, but
18-
# no shorter
19-
DEFAULT_TIMEOUT = 30
20-
2116
# Service error codes
2217
# https://docs.microsoft.com/en-us/windows/desktop/debug/system-error-codes--1000-1299-
2318
ERROR_SERVICE_DOES_NOT_EXIST = 0x00000424

0 commit comments

Comments
 (0)