$ho->{PowerApproaches} = \@approaches;
}
-sub power_reboot_attempts ($$$) {
- my ($ho, $setup, $await) = @_;
+sub power_reboot_attempts ($$$;$) {
+ my ($ho, $setup, $await, $approach_re) = @_;
# Power cycles $ho, calling $setup->() while it is (supposedly) off.
# Then, just after turning $ho on, calls $await->().
# If $await->() succeeds, great: returns.
MethObjs => power_cycle_parse_method($ho, 'ssh'),
};
foreach my $approach ($ssh, @{ $ho->{PowerApproaches} }) {
+ next if defined $approach_re && $approach->{Name} !~ qr{$approach_re};
logm("power: trying to reboot $ho->{Name} (using $approach->{Name})");
if (eval {
power_approach_invoke($ho, $approach, 0);