]> xenbits.xensource.com Git - osstest.git/commitdiff
Executive: Support host_check_allocated outside a job.
authorIan Jackson <Ian.Jackson@eu.citrix.com>
Wed, 5 Aug 2015 10:42:10 +0000 (11:42 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 5 Aug 2015 16:08:59 +0000 (17:08 +0100)
When called outside a job there are no hostflags, so get_hostflags
cannot be used. Instead assume a new pseudo-flag "OUTSIDE-JOB" when
there is no $job.

Otherwise uses of select_host such as "mg-hosts mkpxedir" fail.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
[ ijc -- wrong commit message ]

Osstest/JobDB/Executive.pm

index 1ec947eb7c0f642749182e8be1df6fb4e0781eda..cc52f57f8083594f4e0f706ec27b6aa41d09ab17 100644 (file)
@@ -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} }