4 |
use warnings; |
use warnings; |
5 |
|
|
6 |
use Module::Pluggable; |
use Module::Pluggable; |
7 |
use Data::Dump qw/dump/; |
use MDAP; |
|
|
|
|
my $debug = 0; |
|
|
my $verbose = 1; |
|
8 |
|
|
9 |
my $commands = [ |
my $commands = [ |
10 |
'service system modify name=MDAP log=enabled', |
'service system modify name=MDAP log=enabled', |
17 |
|
|
18 |
sub check { |
sub check { |
19 |
my ( $self, $h ) = @_; |
my ( $self, $h ) = @_; |
|
warn "## ",__PACKAGE__,"check(",dump($h),")" if $debug; |
|
20 |
|
|
21 |
my $serial = $h->{'_PROD_SERIAL_NBR'} || die "no serial?"; |
my $serial = $h->{'_PROD_SERIAL_NBR'} || die "no serial?"; |
22 |
|
|
23 |
foreach my $command ( @$commands ) { |
foreach my $command ( @$commands ) { |
24 |
next if $ant_command->{$serial}->{$command}++; |
next if $ant_command->{$serial}->{$command}++; |
|
|
|
|
warn "## sending command $command to $serial ", |
|
|
$h->{'_VARIANT_FRIENDLY_NAME'}, " ", |
|
|
$h->{'_BOARD_NAME'}, " ", |
|
|
$h->{'_BUILD'}, |
|
|
"\n" if $verbose; |
|
|
|
|
25 |
return $command; |
return $command; |
26 |
} |
} |
27 |
|
|
28 |
warn "OK ",__PACKAGE__," $serial all commands sent\n" if $verbose; |
once "OK ",__PACKAGE__," $serial all commands sent"; |
29 |
return; |
return; |
30 |
} |
} |
31 |
|
|