| 1 | package Tapper::Action::Plugin::resume::OSRC; | ||||||||||||||||||||||||
| 2 | 3 | our $AUTHORITY = 'cpan:TAPPER'; | |||||||||||||||||||||||
| 3 | 3 | $Tapper::Action::Plugin::resume::OSRC::VERSION = '5.0.0'; | |||||||||||||||||||||||
| 4 | 3 | ▶ | use strict; | ||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||
| 5 | 3 | ▶ | use warnings; | ||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||
| 8 | sub execute | ||||||||||||||||||||||||
| 9 | 2 | ▶ | { | ||||||||||||||||||||||
|
Subroutine
execute: called CC=6 SCAR=18.5
Pod
documented
| |||||||||||||||||||||||||
| 10 | 2 | my ($action, $message, $options) = @_; | |||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||
| 12 | 2 | $SIG{CHLD} = 'IGNORE'; | |||||||||||||||||||||||
| 13 | 2 | my $pid = fork(); | |||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||
| 15 | 2 | ▶ | die ("Can not fork in __PACKAGE__: $!") if not defined $pid; | ||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||
| 16 | 2 | ▶ | if ($pid == 0) { | ||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||
| 17 | 1 | my $host = $message->{host}; | |||||||||||||||||||||||
| 18 | 1 | ▶ | sleep( $message->{after} || $action->cfg->{action}{resume}{default_sleeptime} || 0); | ||||||||||||||||||||||
|
Condition40%2/5
$message->{'after'} || $action->cfg->{'action'}{'resume'}{'default_sleeptime'} || 0
$message->{"after"} or $action->cfg->{"action"}{"resume"}{"default_sleeptime"}
MC/DC0%0/2
$message->{'after'} || $action->cfg->{'action'}{'resume'}{'default_sleeptime'} || 0
$message->{"after"}
$action->cfg->{"action"}{"resume"}{"default_sleeptime"}
Truth table33%1/3
A or B
A= $message->{"after"}B= $action->cfg->{"action"}{"resume"}{"default_sleeptime"}
| |||||||||||||||||||||||||
| 19 | 1 | my $cmd = $options->{cmd} . " $host"; | |||||||||||||||||||||||
| 20 | 1 | my ($error, $retval) = $action->log_and_exec($cmd); | |||||||||||||||||||||||
| 21 | 1 | ▶ | $action->log->error($retval) if $error; | ||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||
| 22 | 1 | exit 0; | |||||||||||||||||||||||
| 23 | } | ||||||||||||||||||||||||
| 24 | 1 | return; | |||||||||||||||||||||||
| 25 | } | ||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||
| 28 | 3 | 1; # End of Tapper::Action::Plugin::resume::OSRC | |||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||
| 30 | __END__ | ||||||||||||||||||||||||