diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index c8fe88a50..42816e7de 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -200,5 +200,5 @@ jobs: repo_token: ${{ secrets.GITHUB_TOKEN }} slack_webhook_url: ${{ secrets.SLACK_WEBHOOK }} # Optional Input - channel: '#team-ia-bots' + channel: '#team-cat-bots' name: 'GABot' diff --git a/.github/workflows/spec.yml b/.github/workflows/spec.yml index 2f6aa5361..6c1ae10d8 100644 --- a/.github/workflows/spec.yml +++ b/.github/workflows/spec.yml @@ -54,10 +54,10 @@ jobs: buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Environment' echo STEP_ID=Setup-Acceptance-Test-Matrix >> $GITHUB_ENV echo STEP_START=$(date +%s) >> $GITHUB_ENV -# - name: Run Static & Syntax Tests -# if: ${{ github.repository_owner == 'puppetlabs' }} -# run: | -# buildevents cmd $TRACE_ID $STEP_ID 'static_syntax_checks' -- bundle exec rake syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop + - name: Run Static & Syntax Tests + if: ${{ github.repository_owner == 'puppetlabs' }} + run: | + buildevents cmd $TRACE_ID $STEP_ID 'static_syntax_checks' -- bundle exec rake syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop - name: Setup Spec Test Matrix id: get-matrix diff --git a/functions/ensure.pp b/functions/ensure.pp index 6019be631..8f7ea63a7 100644 --- a/functions/ensure.pp +++ b/functions/ensure.pp @@ -1,30 +1,30 @@ # @summary function to cast ensure parameter to resource specific value function stdlib::ensure( - Variant[Boolean, Enum['present', 'absent']] $ensure, - Enum['directory', 'link', 'mounted', 'service', 'file', 'package'] $resource, + Variant[Boolean, Enum['present', 'absent']] $ensure, + Enum['directory', 'link', 'mounted', 'service', 'file', 'package'] $resource, ) >> String { - $_ensure = $ensure ? { - Boolean => $ensure.bool2str('present', 'absent'), - default => $ensure, + $_ensure = $ensure ? { + Boolean => $ensure.bool2str('present', 'absent'), + default => $ensure, + } + case $resource { + 'package': { + $_ensure ? { + 'present' => 'installed', + default => 'absent', + } } - case $resource { - 'package': { - $_ensure ? { - 'present' => 'installed', - default => 'absent', - } - } - 'service': { - $_ensure ? { - 'present' => 'running', - default => 'stopped', - } - } - default: { - $_ensure ? { - 'present' => $resource, - default => $_ensure, - } - } + 'service': { + $_ensure ? { + 'present' => 'running', + default => 'stopped', + } } + default: { + $_ensure ? { + 'present' => $resource, + default => $_ensure, + } + } + } } diff --git a/lib/puppet/parser/functions/validate_integer.rb b/lib/puppet/parser/functions/validate_integer.rb index 4ec05b0bb..f1e8be4d6 100644 --- a/lib/puppet/parser/functions/validate_integer.rb +++ b/lib/puppet/parser/functions/validate_integer.rb @@ -119,13 +119,11 @@ module Puppet::Parser::Functions when Array # check every element of the array input.each_with_index do |arg, pos| - begin - raise TypeError if arg.is_a?(Hash) - arg = Integer(arg.to_s) - validator.call(arg) - rescue TypeError, ArgumentError - raise Puppet::ParseError, "validate_integer(): Expected element at array position #{pos} to be an Integer, got #{arg.class}" - end + raise TypeError if arg.is_a?(Hash) + arg = Integer(arg.to_s) + validator.call(arg) + rescue TypeError, ArgumentError + raise Puppet::ParseError, "validate_integer(): Expected element at array position #{pos} to be an Integer, got #{arg.class}" end # for the sake of compatibility with ruby 1.8, we need extra handling of hashes when Hash diff --git a/lib/puppet/parser/functions/validate_numeric.rb b/lib/puppet/parser/functions/validate_numeric.rb index 1bbc6672f..c836e9ed8 100644 --- a/lib/puppet/parser/functions/validate_numeric.rb +++ b/lib/puppet/parser/functions/validate_numeric.rb @@ -79,13 +79,11 @@ module Puppet::Parser::Functions when Array # check every element of the array input.each_with_index do |arg, pos| - begin - raise TypeError if arg.is_a?(Hash) - arg = Float(arg.to_s) - validator.call(arg) - rescue TypeError, ArgumentError - raise Puppet::ParseError, "validate_numeric(): Expected element at array position #{pos} to be a Numeric, got #{arg.class}" - end + raise TypeError if arg.is_a?(Hash) + arg = Float(arg.to_s) + validator.call(arg) + rescue TypeError, ArgumentError + raise Puppet::ParseError, "validate_numeric(): Expected element at array position #{pos} to be a Numeric, got #{arg.class}" end # for the sake of compatibility with ruby 1.8, we need extra handling of hashes when Hash diff --git a/metadata.json b/metadata.json index f2b2644c8..7a644e447 100644 --- a/metadata.json +++ b/metadata.json @@ -115,5 +115,5 @@ "description": "Standard Library for Puppet Modules", "pdk-version": "2.3.0", "template-url": "https://github.com/puppetlabs/pdk-templates#main", - "template-ref": "heads/main-0-gf3911d3" + "template-ref": "heads/main-0-g806810b" }