From 3a3af3eb15743a291a2a17a7b7f40ea7ff90050c Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 9 Mar 2015 17:40:11 +0000 Subject: [PATCH] convert-cabinet-layout: fixes, mg-hosts setprops Serial --- convert-cabinet-layout | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/convert-cabinet-layout b/convert-cabinet-layout index 3582ec0..d9e7e93 100755 --- a/convert-cabinet-layout +++ b/convert-cabinet-layout @@ -61,7 +61,7 @@ sub outfor ($$) { sub setprop ($$) { my ($prop,$value) = @_; - outfor 'mg-hosts setprops $prop', + outfor "mg-hosts setprops $prop", "./mg-hosts setprops $machine -- $prop '$value'\n"; } @@ -95,8 +95,17 @@ while (my $row = $csv->getline_hr($fh)) { if ($pdu1) { $pdu='pdu1'; $port=$pdu1; } if ($pdu2) { $pdu='pdu2'; $port=$pdu2; } setprop 'PowerMethod', "msw --apc6 $pdu $port"; - } + }; reportno 'PowerMethod'; + + eval { + my $serial = $row->{'Comtrol 1'}; + $serial =~ m#^(\d+)/ttyRP(\d+)$# or die "bad serial syntax\n"; + my ($physport, $ttyrp) = ($1,$2); + $physport eq $ttyrp+1 or die "serial numbering mismatch\n"; + setprop 'Serial', "sympathy serial0"; + }; + reportno 'Serial'; } close $fh or die $!; -- 2.39.5