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 ]
$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} }