Skip to content

Commit cdae5da

Browse files
(PE-40163) deal with empty csr attributes
1 parent 436b89e commit cdae5da

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

plans/replace_failed_postgresql.pp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
# Bail if this is trying to be ran against Standard
3131
if $compilers.empty {
32-
fail_plan('Plan peadm::add_database is only applicable for L and XL deployments')
32+
fail_plan('Plan peadm::replace_failed_postgresql is only applicable for L and XL deployments')
3333
}
3434

3535
$pe_hosts = peadm::flatten_compact([
@@ -47,7 +47,6 @@
4747
)
4848

4949
# Restart pe-puppetdb.service on Puppet server primary and replica
50-
# run_task('service', $pe_hosts, 'action' => 'restart', 'name' => 'pe-puppetdb.service')
5150
run_task('service', $pe_hosts, { action => 'restart', name => 'pe-puppetdb.service' })
5251

5352
# Purge failed PE-PostgreSQL node from PuppetDB

plans/util/insert_csr_extension_requests.pp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@
1515
# If we're merging extension requests, existing requests will be preserved.
1616
# If we're not merging, only ours will be used; existing requests will be
1717
# overwritten.
18-
$csr_file_data = $merge ? {
19-
true => $csr_attributes_data.deep_merge({ 'extension_requests' => $extension_requests }),
20-
false => ($csr_attributes_data + { 'extension_requests' => $extension_requests }),
18+
if $merge and !$csr_attributes_data.empty {
19+
$csr_file_data = $csr_attributes_data.deep_merge({ 'extension_requests' => $extension_requests })
20+
} else {
21+
$csr_file_data = $csr_attributes_data + { 'extension_requests' => $extension_requests }
2122
}
2223

2324
run_task('peadm::mkdir_p_file', $target,

0 commit comments

Comments
 (0)