xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Ian Jackson <ian.jackson@eu.citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <ian.campbell@citrix.com>
Subject: [OSSTEST PATCH 2/2] ms-* html generation: Provide right title for projection
Date: Mon, 4 Jan 2016 16:49:38 +0000	[thread overview]
Message-ID: <1451926178-10812-3-git-send-email-ian.jackson@eu.citrix.com> (raw)
In-Reply-To: <1451926178-10812-1-git-send-email-ian.jackson@eu.citrix.com>

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 datte until ms-queuedaemon is also
restarted.

In either case nothing will go badly wrong.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 ms-planner     |    7 ++++++-
 ms-queuedaemon |    2 +-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/ms-planner b/ms-planner
index 7ce0405..6f4a511 100755
--- a/ms-planner
+++ b/ms-planner
@@ -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);
diff --git a/ms-queuedaemon b/ms-queuedaemon
index 08f88cf..2b8d621 100755
--- a/ms-queuedaemon
+++ b/ms-queuedaemon
@@ -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
-- 
1.7.10.4

  parent reply	other threads:[~2016-01-04 16:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-04 16:49 [OSSTEST PATCH 0/2] ms-* html generation: Provide <title>s Ian Jackson
2016-01-04 16:49 ` [OSSTEST PATCH 1/2] ms-* html generation: Provide <title> Ian Jackson
2016-01-05 10:28   ` Ian Campbell
2016-01-04 16:49 ` Ian Jackson [this message]
2016-01-05 10:30   ` [OSSTEST PATCH 2/2] ms-* html generation: Provide right title for projection Ian Campbell
2016-01-05 16:59     ` Ian Jackson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1451926178-10812-3-git-send-email-ian.jackson@eu.citrix.com \
    --to=ian.jackson@eu.citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).