From: Ian Jackson Date: Mon, 9 Mar 2015 17:36:04 +0000 (+0000) Subject: convert-cabinet-layout: generates PowerMethod X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=94ca7c42128f53cf5c576ebafb880aafddcb204c;p=people%2Fiwj%2Fcolo-for-testing.git convert-cabinet-layout: generates PowerMethod --- diff --git a/convert-cabinet-layout b/convert-cabinet-layout index 4c61dbf..978cc40 100755 --- a/convert-cabinet-layout +++ b/convert-cabinet-layout @@ -80,6 +80,18 @@ while (my $row = $csv->getline_hr($fh)) { (length($machine)<=6 ? "\t" : ""), $mac; }; reportno 'Ether'; + + eval { + my $pdu1 = $row->{'PDU-1 Port'}; + my $pdu2 = $row->{'PDU-2 Port'}; + !!$pdu1 != !!$pdu2 or die "wrong # pdus\n"; + my ($pdu,$port); + if ($pdu1) { $pdu='pdu1'; $port=$pdu1; } + if ($pdu2) { $pdu='pdu2'; $port=$pdu2; } + outfor 'mg-hosts setprops PowerMethod', + sprintf "./mg-hosts setprops %s -- PowerMethod 'msw --apc6 %s %d'\n", + $machine, $pdu, $port; + } } close $fh or die $!;