Skip to content

Commit 586a80b

Browse files
committed
(PE-39429) Use correct targets and only run if those targets are non-empty. This fixes errors about run_command needing 3 args when no compilers are present
1 parent 5a4e19c commit 586a80b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

plans/convert.pp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,10 +305,14 @@
305305
# Restart cluster compiler services that are likely not restarted by our
306306
# final Puppet run to increase chance everything is functional upon plan
307307
# completion
308-
run_command('systemctl restart pe-puppetserver.service', $legacy_compiler_targets)
308+
if $legacy_compiler_targets {
309+
run_command('systemctl restart pe-puppetserver.service', $legacy_compiler_targets)
310+
}
309311
310312
# PuppetDB is only found on modern compilers, not legacy ones
311-
run_command('systemctl restart pe-puppetdb.service pe-puppetserver.service', $compiler_hosts)
313+
if $compiler_targets {
314+
run_command('systemctl restart pe-puppetserver.service pe-puppetdb.service', $compiler_targets)
315+
}
312316
313317
# Run puppet on all targets again to ensure everything is fully up-to-date
314318
run_task('peadm::puppet_runonce', $all_targets)

0 commit comments

Comments
 (0)