Skip to content

Commit

Permalink
(PUP-11319) Move DEFAULT_TIMEOUT constant for Windows services
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
luchihoratiu committed Oct 14, 2021
1 parent 64ba729 commit 2163522
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 3 additions & 0 deletions lib/puppet/util/windows.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ class Group < ADSIObject; end
module File; end
module Registry
end
module Service
DEFAULT_TIMEOUT = 30
end
module SID
class Principal; end
end
Expand Down
5 changes: 0 additions & 5 deletions lib/puppet/util/windows/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ module Service

FILE = Puppet::Util::Windows::File

# integer value of the floor for timeouts when waiting for service pending states.
# puppet will wait the length of dwWaitHint if it is longer than this value, but
# no shorter
DEFAULT_TIMEOUT = 30

# Service error codes
# https://docs.microsoft.com/en-us/windows/desktop/debug/system-error-codes--1000-1299-
ERROR_SERVICE_DOES_NOT_EXIST = 0x00000424
Expand Down

0 comments on commit 2163522

Please sign in to comment.