]> xenbits.xensource.com Git - people/iwj/osstest.git/commitdiff
ms-* html generation: Provide right title for projection
authorIan Jackson <ian.jackson@eu.citrix.com>
Mon, 4 Jan 2016 16:17:15 +0000 (16:17 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Tue, 5 Jan 2016 17:42:28 +0000 (17:42 +0000)
When ms-queuedaemon generates a resource-projection.html, it sometimes
does so from data-plan.pl (see proc report-plan).  This means that
ms-planner does not get a reliable indication of whether it is being
run for the plan or the projection, and the resource-project.html
sometimes claims to be the plan.

Fix with a new ms-planner option -W which tells it what to put in the
title, defaulting to the value passed to -w.

DEPLOYMENT NOTE:

The new ms-planner works with the old queuedaemon, so when upgrading,
it is OK to simply update the daemons-testing.git and then restart the
ms-queuedaemon.

If it is necessary to downgrade, rewinding to the old commit with a
running ms-queuedaemon will cause errors from the old ms-planner being
passed -w -- but these errors are trapped and ignored.  So in this
case reports will be out of date until ms-queuedaemon is also
restarted.

In either case nothing will go badly wrong.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
ms-planner
ms-queuedaemon

index 7ce0405a843569ef82d8959cfeca12b5cf9d9703..6f4a5115516fac5ad07ae83ae0dda9750ecbf618 100755 (executable)
@@ -34,6 +34,7 @@ use Osstest::Executive;
 open DEBUG, ">/dev/null" or die $!;
 
 our $walker = 'plan';
+our $walker_show;
 
 while (@ARGV and $ARGV[0] =~ m/^-/) {
     $_= shift @ARGV;
@@ -43,12 +44,16 @@ while (@ARGV and $ARGV[0] =~ m/^-/) {
             open DEBUG, ">&STDERR" or die $!;
         } elsif (s/^-w(.+)/-/) {
            $walker = $1;
+        } elsif (s/^-W(.+)/-/) {
+           $walker_show = $1;
         } else {
             die "$_ ?";
         }
     }
 }
 
+$walker_show //= $walker;
+
 csreadconfig();
 
 our ($plan);
@@ -688,7 +693,7 @@ sub cmd_show_html () {
     #    Dumper(\@rows, \@newoutcols);
 
     printf "<html><head><title>Resource %s - %s</title></head><body>\n",
-        $walker, ($c{DnsDomain} // '?');
+        $walker_show, ($c{DnsDomain} // '?');
 
     printf "<table rules=all><tr><td>plan age %s</td><td>report at %s</td>\n",
         show_rel_time($now);
index 08f88cf3541052a97b7d94ff870182daea3571fd..2b8d621e3b0b156bdb85786d2a75d10b8830387c 100755 (executable)
@@ -301,7 +301,7 @@ proc report-plan {w wo} {
     global c
     catching-internally "showing $w html" {
        set outputfile "$c(WebspaceFile)/resource-$wo.html"
-       exec ./ms-planner -w$w show-html > $outputfile
+       exec ./ms-planner -w$w -W$wo show-html > $outputfile
     } {
        set out data-$wo.final.pl
        file copy -force data-$w.pl $out.new