]> xenbits.xensource.com Git - people/iwj/colo-for-testing.git/commitdiff
convert-cabinet-layout: fixes, mg-hosts setprops Serial
authorIan Jackson <ian.jackson@eu.citrix.com>
Mon, 9 Mar 2015 17:40:11 +0000 (17:40 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Mon, 9 Mar 2015 17:40:11 +0000 (17:40 +0000)
convert-cabinet-layout

index 3582ec0f1ebc904c18b566ecba52d0fe8748aac0..d9e7e932c20c6ebfa10947c37b8cc1c0f93aca2b 100755 (executable)
@@ -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 $!;