]> xenbits.xensource.com Git - people/iwj/colo-for-testing.git/commitdiff
convert-cabinet-layout: generates PowerMethod
authorIan Jackson <ian.jackson@eu.citrix.com>
Mon, 9 Mar 2015 17:36:04 +0000 (17:36 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Mon, 9 Mar 2015 17:36:04 +0000 (17:36 +0000)
convert-cabinet-layout

index 4c61dbf0bc2d6ac1fa69fdd87d823c7b61606d0e..978cc4098e37336c4f10fadde1c1004510b660da 100755 (executable)
@@ -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 $!;