@@ -368,7 +368,7 @@ def insync?(context, name, _property_name, _is_hash, should_hash)
368
368
# @param context [Object] the Puppet runtime context to operate in and send feedback to
369
369
# @param name_hash [Hash] the hash of namevars to be passed as properties to `Invoke-DscResource`
370
370
# @return [Hash] returns a hash representing the DSC resource munged to the representation the Puppet Type expects
371
- def invoke_get_method ( context , name_hash ) # rubocop:disable Metrics/AbcSize
371
+ def invoke_get_method ( context , name_hash )
372
372
context . debug ( "retrieving #{ name_hash . inspect } " )
373
373
374
374
query_props = name_hash . select { |k , v | mandatory_get_attributes ( context ) . include? ( k ) || ( k == :dsc_psdscrunascredential && !v . nil? ) }
@@ -384,8 +384,8 @@ def invoke_get_method(context, name_hash) # rubocop:disable Metrics/AbcSize
384
384
# Canonicalize the results to match the type definition representation;
385
385
# failure to do so will prevent the resource_api from comparing the result
386
386
# to the should hash retrieved from the resource definition in the manifest.
387
- data . keys . each do |key | # rubocop:disable Style/HashEachMethods
388
- type_key = "dsc_#{ key . downcase } " . to_sym
387
+ data . keys . each do |key |
388
+ type_key = : "dsc_#{ key . downcase } "
389
389
data [ type_key ] = data . delete ( key )
390
390
391
391
# Special handling for CIM Instances
@@ -557,7 +557,7 @@ def puppetize_name(name)
557
557
# Puppet module names must only include lowercase letters, digits and underscores
558
558
name = name . gsub ( /[^a-z0-9_]/ , '_' )
559
559
# Puppet module names must not start with a number so if it does, append the letter 'a' to the name. Eg: '7zip' becomes 'a7zip'
560
- name = name . match? ( /^\d / ) ? "a #{ name } " : name # rubocop:disable Lint/UselessAssignment
560
+ name = "a #{ name } " if name . match? ( /^\d / ) # rubocop:disable Lint/UselessAssignment
561
561
end
562
562
563
563
# Return a UUID with the dashes turned into underscores to enable the specifying of guaranteed-unique
@@ -598,7 +598,7 @@ def logon_failed_already?(credential_hash)
598
598
# @param enumerable [Enumerable] a string, array, hash, or other object to attempt to recursively downcase
599
599
def downcase_hash_keys! ( enumerable )
600
600
if enumerable . is_a? ( Hash )
601
- enumerable . keys . each do |key | # rubocop:disable Style/HashEachMethods
601
+ enumerable . keys . each do |key |
602
602
name = key . dup . downcase
603
603
enumerable [ name ] = enumerable . delete ( key )
604
604
downcase_hash_keys! ( enumerable [ name ] ) if enumerable [ name ] . is_a? ( Enumerable )
@@ -1063,7 +1063,7 @@ def escape_quotes(text)
1063
1063
# With multiple methods which need to discover secrets it is necessary to keep a single regex
1064
1064
# which can discover them. This will lazily match everything in a single-quoted string which
1065
1065
# ends with the secret postfix id and mark the actual contents of the string as the secret.
1066
- SECRET_DATA_REGEX = /'(?<secret>[^']+)+?#{ Regexp . quote ( SECRET_POSTFIX ) } '/ . freeze
1066
+ SECRET_DATA_REGEX = /'(?<secret>[^']+)+?#{ Regexp . quote ( SECRET_POSTFIX ) } '/
1067
1067
1068
1068
# Strings containing sensitive data have a secrets postfix. These strings cannot be passed
1069
1069
# directly either to debug streams or to PowerShell and must be handled; this method contains
0 commit comments