Skip to content

Commit e428e18

Browse files
authored
Merge pull request #1234 from puppetlabs/pdksync_maint/pdk_update_20-04
pdksync - (Maint) PDK Update
2 parents 23fdf23 + fde76f5 commit e428e18

File tree

6 files changed

+40
-44
lines changed

6 files changed

+40
-44
lines changed

.github/workflows/nightly.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,5 +200,5 @@ jobs:
200200
repo_token: ${{ secrets.GITHUB_TOKEN }}
201201
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK }}
202202
# Optional Input
203-
channel: '#team-ia-bots'
203+
channel: '#team-cat-bots'
204204
name: 'GABot'

.github/workflows/spec.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ jobs:
5454
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Environment'
5555
echo STEP_ID=Setup-Acceptance-Test-Matrix >> $GITHUB_ENV
5656
echo STEP_START=$(date +%s) >> $GITHUB_ENV
57-
# - name: Run Static & Syntax Tests
58-
# if: ${{ github.repository_owner == 'puppetlabs' }}
59-
# run: |
60-
# 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
57+
- name: Run Static & Syntax Tests
58+
if: ${{ github.repository_owner == 'puppetlabs' }}
59+
run: |
60+
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
6161
6262
- name: Setup Spec Test Matrix
6363
id: get-matrix

functions/ensure.pp

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
# @summary function to cast ensure parameter to resource specific value
22
function stdlib::ensure(
3-
Variant[Boolean, Enum['present', 'absent']] $ensure,
4-
Enum['directory', 'link', 'mounted', 'service', 'file', 'package'] $resource,
3+
Variant[Boolean, Enum['present', 'absent']] $ensure,
4+
Enum['directory', 'link', 'mounted', 'service', 'file', 'package'] $resource,
55
) >> String {
6-
$_ensure = $ensure ? {
7-
Boolean => $ensure.bool2str('present', 'absent'),
8-
default => $ensure,
6+
$_ensure = $ensure ? {
7+
Boolean => $ensure.bool2str('present', 'absent'),
8+
default => $ensure,
9+
}
10+
case $resource {
11+
'package': {
12+
$_ensure ? {
13+
'present' => 'installed',
14+
default => 'absent',
15+
}
916
}
10-
case $resource {
11-
'package': {
12-
$_ensure ? {
13-
'present' => 'installed',
14-
default => 'absent',
15-
}
16-
}
17-
'service': {
18-
$_ensure ? {
19-
'present' => 'running',
20-
default => 'stopped',
21-
}
22-
}
23-
default: {
24-
$_ensure ? {
25-
'present' => $resource,
26-
default => $_ensure,
27-
}
28-
}
17+
'service': {
18+
$_ensure ? {
19+
'present' => 'running',
20+
default => 'stopped',
21+
}
2922
}
23+
default: {
24+
$_ensure ? {
25+
'present' => $resource,
26+
default => $_ensure,
27+
}
28+
}
29+
}
3030
}

lib/puppet/parser/functions/validate_integer.rb

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,11 @@ module Puppet::Parser::Functions
119119
when Array
120120
# check every element of the array
121121
input.each_with_index do |arg, pos|
122-
begin
123-
raise TypeError if arg.is_a?(Hash)
124-
arg = Integer(arg.to_s)
125-
validator.call(arg)
126-
rescue TypeError, ArgumentError
127-
raise Puppet::ParseError, "validate_integer(): Expected element at array position #{pos} to be an Integer, got #{arg.class}"
128-
end
122+
raise TypeError if arg.is_a?(Hash)
123+
arg = Integer(arg.to_s)
124+
validator.call(arg)
125+
rescue TypeError, ArgumentError
126+
raise Puppet::ParseError, "validate_integer(): Expected element at array position #{pos} to be an Integer, got #{arg.class}"
129127
end
130128
# for the sake of compatibility with ruby 1.8, we need extra handling of hashes
131129
when Hash

lib/puppet/parser/functions/validate_numeric.rb

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,11 @@ module Puppet::Parser::Functions
7979
when Array
8080
# check every element of the array
8181
input.each_with_index do |arg, pos|
82-
begin
83-
raise TypeError if arg.is_a?(Hash)
84-
arg = Float(arg.to_s)
85-
validator.call(arg)
86-
rescue TypeError, ArgumentError
87-
raise Puppet::ParseError, "validate_numeric(): Expected element at array position #{pos} to be a Numeric, got #{arg.class}"
88-
end
82+
raise TypeError if arg.is_a?(Hash)
83+
arg = Float(arg.to_s)
84+
validator.call(arg)
85+
rescue TypeError, ArgumentError
86+
raise Puppet::ParseError, "validate_numeric(): Expected element at array position #{pos} to be a Numeric, got #{arg.class}"
8987
end
9088
# for the sake of compatibility with ruby 1.8, we need extra handling of hashes
9189
when Hash

metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,5 +115,5 @@
115115
"description": "Standard Library for Puppet Modules",
116116
"pdk-version": "2.3.0",
117117
"template-url": "https://github.com/puppetlabs/pdk-templates#main",
118-
"template-ref": "heads/main-0-gf3911d3"
118+
"template-ref": "heads/main-0-g806810b"
119119
}

0 commit comments

Comments
 (0)