line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Cinnamon::Runner; |
2
|
3
|
|
|
3
|
|
20
|
use strict; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
92
|
|
3
|
3
|
|
|
3
|
|
14
|
use warnings; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
90
|
|
4
|
|
|
|
|
|
|
|
5
|
3
|
|
|
3
|
|
12
|
use Cinnamon::Logger; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
104
|
|
6
|
3
|
|
|
3
|
|
13
|
use Cinnamon::Config; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
445
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub start { |
9
|
0
|
|
|
0
|
0
|
|
my ($class, $hosts, $task, @args) = @_; |
10
|
|
|
|
|
|
|
|
11
|
0
|
|
|
|
|
|
my %result; |
12
|
0
|
|
|
|
|
|
for my $host (@$hosts) { |
13
|
0
|
|
|
|
|
|
$result{$host} = +{ error => 0 }; |
14
|
|
|
|
|
|
|
|
15
|
0
|
|
|
|
|
|
eval { $task->($host, @args) }; |
|
0
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
|
17
|
0
|
0
|
|
|
|
|
if ($@) { |
18
|
0
|
|
|
|
|
|
chomp $@; |
19
|
0
|
|
|
|
|
|
log error => sprintf '[%s] %s', $host, $@; |
20
|
0
|
|
|
|
|
|
$result{$host}->{error}++ ; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
0
|
|
|
|
|
|
\%result; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub execute { |
28
|
0
|
|
|
0
|
0
|
|
my ($class, $host, $task, @args) = @_; |
29
|
0
|
|
|
|
|
|
$task->($host, @args); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
!!1; |