Skip to content

Commit

Permalink
Merge pull request #366 from puppetlabs/bug-fix_dsc_timeout
Browse files Browse the repository at this point in the history
(Bug): do not pass dsc_timeout as timeout parameter to DSC resource params
  • Loading branch information
pmcmaw authored Feb 14, 2025
2 parents c45001a + 87fc0e2 commit 3c4af88
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/puppet/provider/dsc_base_provider/dsc_base_provider.rb
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,7 @@ def format_ciminstance(variable_name, class_name, property_hash)
#
# @param resource [Hash] a hash with the information needed to run `Invoke-DscResource`
# @return [String] A string representing the PowerShell definition of the InvokeParams hash
def invoke_params(resource)
def invoke_params(resource) # rubocop:disable Metrics/MethodLength
params = {
Name: resource[:dscmeta_resource_friendly_name],
Method: resource[:dsc_invoke_method],
Expand All @@ -917,6 +917,10 @@ def invoke_params(resource)
params[:ModuleName] = resource[:dscmeta_module_name]
end
resource[:parameters].each do |property_name, property_hash|
# ignore dsc_timeout, since it is only used to specify the powershell command timeout
# and timeout itself is not a parameter to the DSC resource
next if property_name == :dsc_timeout

# strip dsc_ from the beginning of the property name declaration
name = property_name.to_s.gsub(/^dsc_/, '').to_sym
params[:Property][name] = case property_hash[:mof_type]
Expand Down

0 comments on commit 3c4af88

Please sign in to comment.