All of lore.kernel.org
 help / color / mirror / Atom feed
* [OSSTEST PATCH 0/2] ms-* html generation: Provide <title>s
@ 2016-01-04 16:49 Ian Jackson
  2016-01-04 16:49 ` [OSSTEST PATCH 1/2] ms-* html generation: Provide <title> Ian Jackson
  2016-01-04 16:49 ` [OSSTEST PATCH 2/2] ms-* html generation: Provide right title for projection Ian Jackson
  0 siblings, 2 replies; 6+ messages in thread
From: Ian Jackson @ 2016-01-04 16:49 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Campbell

These two patches provide proper HTML titles for the planner output.

I have tested them by running them in the Citrix Cambridge instance,
where they are currently live.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [OSSTEST PATCH 1/2] ms-* html generation: Provide <title>
  2016-01-04 16:49 [OSSTEST PATCH 0/2] ms-* html generation: Provide <title>s Ian Jackson
@ 2016-01-04 16:49 ` Ian Jackson
  2016-01-05 10:28   ` Ian Campbell
  2016-01-04 16:49 ` [OSSTEST PATCH 2/2] ms-* html generation: Provide right title for projection Ian Jackson
  1 sibling, 1 reply; 6+ messages in thread
From: Ian Jackson @ 2016-01-04 16:49 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson, Ian Campbell

This means that these browser windows will actually get titles!

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 ms-flights-summary |    2 ++
 ms-planner         |    5 ++++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/ms-flights-summary b/ms-flights-summary
index ec8fa18..ea72088 100755
--- a/ms-flights-summary
+++ b/ms-flights-summary
@@ -347,6 +347,8 @@ foreach my $f (keys %flights) {
 
 gather_events();
 
+printf("<html><head><title>Flights - %s</title></head><body>\n",
+       $c{DnsDomain} // '?');
 printf("<p>Report at ".fmttime(time)." based on plan at ".fmttime($plan->{Start})."</p>\n");
 
 printf("<p><h1>Overview</h1></p>\n");
diff --git a/ms-planner b/ms-planner
index fc65a5b..7ce0405 100755
--- a/ms-planner
+++ b/ms-planner
@@ -687,6 +687,9 @@ sub cmd_show_html () {
     #print DEBUG "==============================\n",
     #    Dumper(\@rows, \@newoutcols);
 
+    printf "<html><head><title>Resource %s - %s</title></head><body>\n",
+        $walker, ($c{DnsDomain} // '?');
+
     printf "<table rules=all><tr><td>plan age %s</td><td>report at %s</td>\n",
         show_rel_time($now);
     foreach my $ch (@colheads) {
@@ -753,7 +756,7 @@ sub cmd_show_html () {
 	    printf "</ul>\n";
 	    printf "<p>\n";
     }
-    printf "Report generated %s.\n",
+    printf "Report generated %s.\n</body></html>",
         strftime("%Y-%b-%d %a %H:%M:%S", localtime $now);
     die $! if STDOUT->error;
     die $! unless STDOUT->flush;
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [OSSTEST PATCH 2/2] ms-* html generation: Provide right title for projection
  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-04 16:49 ` Ian Jackson
  2016-01-05 10:30   ` Ian Campbell
  1 sibling, 1 reply; 6+ messages in thread
From: Ian Jackson @ 2016-01-04 16:49 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson, Ian Campbell

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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [OSSTEST PATCH 1/2] ms-* html generation: Provide <title>
  2016-01-04 16:49 ` [OSSTEST PATCH 1/2] ms-* html generation: Provide <title> Ian Jackson
@ 2016-01-05 10:28   ` Ian Campbell
  0 siblings, 0 replies; 6+ messages in thread
From: Ian Campbell @ 2016-01-05 10:28 UTC (permalink / raw)
  To: Ian Jackson, xen-devel

On Mon, 2016-01-04 at 16:49 +0000, Ian Jackson wrote:
> This means that these browser windows will actually get titles!

!

I suppose in theory we ought to also close the <body> tag, but we've not
even been opening it until now, so blah.

> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [OSSTEST PATCH 2/2] ms-* html generation: Provide right title for projection
  2016-01-04 16:49 ` [OSSTEST PATCH 2/2] ms-* html generation: Provide right title for projection Ian Jackson
@ 2016-01-05 10:30   ` Ian Campbell
  2016-01-05 16:59     ` Ian Jackson
  0 siblings, 1 reply; 6+ messages in thread
From: Ian Campbell @ 2016-01-05 10:30 UTC (permalink / raw)
  To: Ian Jackson, xen-devel

On Mon, 2016-01-04 at 16:49 +0000, Ian Jackson wrote:
> 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

"date" (but I expect you will remove this on commit anyway?)

> 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>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [OSSTEST PATCH 2/2] ms-* html generation: Provide right title for projection
  2016-01-05 10:30   ` Ian Campbell
@ 2016-01-05 16:59     ` Ian Jackson
  0 siblings, 0 replies; 6+ messages in thread
From: Ian Jackson @ 2016-01-05 16:59 UTC (permalink / raw)
  To: Ian Campbell; +Cc: xen-devel

Ian Campbell writes ("Re: [OSSTEST PATCH 2/2] ms-* html generation: Provide right title for projection"):
> On Mon, 2016-01-04 at 16:49 +0000, Ian Jackson wrote:
> > DEPLOYMENT NOTE:
...
> > 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
> 
> "date" (but I expect you will remove this on commit anyway?)

Fixed.  I think we should leave these in for the benefit of anyone
else...

Ian.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-01-05 16:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [OSSTEST PATCH 2/2] ms-* html generation: Provide right title for projection Ian Jackson
2016-01-05 10:30   ` Ian Campbell
2016-01-05 16:59     ` Ian Jackson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.