Ian Campbell writes ("[PATCH OSSTEST] get_hostflags: return an empty list when 
there is no flight/job."):
> From: Ian Campbell <ian.campb...@citrix.com>
> 
> Otherwise trying to use mg-hosts mkpxedir fails with:

I think your proposed fix is incorrect.  It is wrong to call
get_hostflags outside the context of a job, because get_hostflags is
supposed to return the job's host flags for that ident.

The bug was introduced by me in 11e788f7 "JobDB/Executive: Improve an
internal `die' error", where a refactoring meant that we always call
get_hostflags.

How about this instead ?

diff --git a/Osstest/JobDB/Executive.pm b/Osstest/JobDB/Executive.pm
index 1ec947e..cc52f57 100644
--- a/Osstest/JobDB/Executive.pm
+++ b/Osstest/JobDB/Executive.pm
@@ -128,7 +128,7 @@ sub host_check_allocated ($$) { #method
         $ho->{Shared} &&
         $ho->{Shared}{State} eq 'ready';
     my $harness = get_harness_rev();
-    my @flags = get_hostflags($ho->{Ident});
+    my @flags = defined($job) ? get_hostflags($ho->{Ident}) : qw(OUTSIDE-JOB);
     $ho->{SharedReady}=
        $ho->{SharedMaybeOthers} &&
         !! (grep { $_." ".$harness eq "share-".$ho->{Shared}{Type} }

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

Ian.

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

Reply via email to