Skip to content

Commit 7869d2f

Browse files
authored
Merge pull request #358 from puppetlabs/PE-36172
(PE-36172) Fixing issues related to stdlib changes
2 parents 3d3356a + 8016fbe commit 7869d2f

File tree

9 files changed

+27
-15
lines changed

9 files changed

+27
-15
lines changed

.github/workflows/test-install-latest-xlarge-dev-nightly.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ on:
55
schedule:
66
- cron: '0 3 * * *'
77
workflow_dispatch:
8+
inputs:
9+
ssh-debugging:
10+
description: 'Boolean; whether or not to pause for ssh debugging'
11+
required: true
12+
default: 'false'
813

914
jobs:
1015
test-install:
@@ -23,6 +28,13 @@ jobs:
2328
- 'almalinux-cloud/almalinux-8'
2429

2530
steps:
31+
- name: 'Start SSH session'
32+
if: ${{ github.event.inputs.ssh-debugging == 'true' }}
33+
uses: luchihoratiu/debug-via-ssh@main
34+
with:
35+
NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }}
36+
SSH_PASS: ${{ secrets.SSH_PASS }}
37+
2638
- name: "Checkout Source"
2739
uses: actions/checkout@v2
2840

functions/determine_status.pp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@
4848
function peadm::determine_status(Array $status_data, Boolean $use_colors = true) >> Hash {
4949
# convert the data into a hash with the sevice names as the keys
5050
$hash_data = $status_data.reduce({}) | $res, $data | {
51-
$res.merge({ $data[service] => $data })
51+
stdlib::merge($res, { $data[service] => $data })
5252
}
5353
$out = $hash_data.reduce({}) | $res, $svc_data | {
5454
$service_name = $svc_data[0]
5555
$server = $svc_data[1][server]
56-
$res.merge("${service_name}/${$server}" => $svc_data[1][state] == 'running')
56+
stdlib::merge($res, { "${service_name}/${server}" => $svc_data[1][state] == 'running' })
5757
}
5858
$bad_status = $out.filter | $item | { ! $item[1] }
5959
$passed_status = $out.filter | $item | { $item[1] }

functions/generate_pe_conf.pp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function peadm::generate_pe_conf (
1414

1515
# Remove anything that is undef, then output to JSON (and therefore HOCON,
1616
# because HOCON is a superset of JSON)
17-
$settings.filter |$key,$value| {
17+
stdlib::to_json_pretty($settings.filter |$key,$value| {
1818
$value != undef
19-
}.to_json_pretty()
20-
}
19+
})
20+
}

metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
"requirements": [
7878
{
7979
"name": "puppet",
80-
"version_requirement": ">= 6.0.2 < 8.0.0"
80+
"version_requirement": ">= 6.0.2 < 9.0.0"
8181
}
8282
],
8383
"pdk-version": "2.6.1",

plans/add_database.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@
199199

200200
run_task('peadm::mkdir_p_file', $postgresql_target,
201201
path => '/etc/puppetlabs/enterprise/conf.d/pe.conf',
202-
content => ($pe_conf.parsejson()).to_json_pretty(),
202+
content => stdlib::to_json_pretty($pe_conf.parsejson()),
203203
)
204204

205205
# Start frontend compiler services so catalogs can once again be compiled by

plans/status.pp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
$stack_status = $results.reduce({}) | $res, $item | {
2222
$data = $item.value[output]
2323
$stack_name = $item.target.peadm::certname()
24-
$status = peadm::determine_status($data, $colors).merge(stack_name => $stack_name )
25-
$res.merge({ $stack_name => $status })
24+
$status = stdlib::merge(peadm::determine_status($data, $colors), { stack_name => $stack_name })
25+
stdlib::merge($res, { $stack_name => $status })
2626
}
2727

2828
$overall_degraded_stacks = $stack_status.filter | $item | { $item[1][status] =~ /degraded/ }
@@ -45,7 +45,7 @@
4545
$passed_table_rows = $overall_passed_stacks.map | $item | { [$item[0], $item[1][status]] }
4646

4747
# produce array of degraded or failed services
48-
$bad_svc_rows = $overall_failed_stacks.merge($overall_degraded_stacks).map | $item | {
48+
$bad_svc_rows = stdlib::merge($overall_failed_stacks, $overall_degraded_stacks).map | $item | {
4949
$item[1][failed].map | $svc | {
5050
[$item[0], *$svc[0].split('/'), peadm::convert_status($svc[1], undef, $colors)]
5151
}

plans/subplans/install.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@
396396

397397
run_task('peadm::mkdir_p_file', $target,
398398
path => '/etc/puppetlabs/enterprise/conf.d/pe.conf',
399-
content => ($pe_conf.parsejson() - $puppetdb_database_temp_config).to_json_pretty(),
399+
content => stdlib::to_json_pretty($pe_conf.parsejson() - $puppetdb_database_temp_config),
400400
)
401401
}
402402

plans/upgrade.pp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,14 +197,14 @@
197197
path => '/etc/puppetlabs/enterprise/conf.d/pe.conf',
198198
).first['content']
199199

200-
$pe_conf = ($current_pe_conf ? {
200+
$pe_conf = stdlib::to_json_pretty($current_pe_conf ? {
201201
undef => {},
202-
default => $current_pe_conf.parsehocon(),
202+
default => stdlib::parsehocon($current_pe_conf),
203203
} + {
204204
'console_admin_password' => 'not used',
205205
'puppet_enterprise::puppet_master_host' => $primary_target.peadm::certname(),
206206
'puppet_enterprise::database_host' => $target.peadm::certname(),
207-
} + $profile_database_puppetdb_hosts).to_json_pretty()
207+
} + $profile_database_puppetdb_hosts)
208208

209209
write_file($pe_conf, '/etc/puppetlabs/enterprise/conf.d/pe.conf', $target)
210210
}

plans/util/insert_csr_extension_requests.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
run_task('peadm::mkdir_p_file', $target,
2424
path => '/etc/puppetlabs/puppet/csr_attributes.yaml',
25-
content => $csr_file_data.to_yaml,
25+
content => stdlib::to_yaml($csr_file_data),
2626
)
2727
}
2828
}

0 commit comments

Comments
 (0)