diff --git a/infrastructure/lib/DPB/Core.pm b/infrastructure/lib/DPB/Core.pm index da29f5d6f4e..99d2724f975 100644 --- a/infrastructure/lib/DPB/Core.pm +++ b/infrastructure/lib/DPB/Core.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: Core.pm,v 1.1.1.1 2010/08/20 13:40:13 espie Exp $ +# $OpenBSD: Core.pm,v 1.2 2010/10/23 17:58:55 espie Exp $ # # Copyright (c) 2010 Marc Espie # @@ -46,6 +46,22 @@ sub fullname return $name; } +sub name_is_localhost +{ + my ($class, $host) = @_; + if ($host eq "localhost" or $host eq DPB::Core::Local->hostname) { + return 1; + } else { + return 0; + } +} + +sub is_localhost +{ + my $o = shift; + return $o->name_is_localhost($o->{host}); +} + # here, a "core" is an entity responsible for scheduling cpu, such as # running a job, which is a collection of tasks. @@ -373,7 +389,7 @@ my $init = {}; sub new { my ($class, $host, $prop) = @_; - if ($host eq "localhost" or $host eq DPB::Core::Local->hostname) { + if (DPB::Host->name_is_localhost($host)) { return $init->{localhost} //= DPB::Core::Local->new_noreg($host, $prop); } else { require DPB::Core::Distant; diff --git a/infrastructure/lib/DPB/Engine.pm b/infrastructure/lib/DPB/Engine.pm index b6c06efd880..4c9ae4f59cf 100644 --- a/infrastructure/lib/DPB/Engine.pm +++ b/infrastructure/lib/DPB/Engine.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: Engine.pm,v 1.1.1.1 2010/08/20 13:40:13 espie Exp $ +# $OpenBSD: Engine.pm,v 1.2 2010/10/23 17:58:55 espie Exp $ # # Copyright (c) 2010 Marc Espie # @@ -77,7 +77,7 @@ sub errors_string my @l = (); for my $e (@{$self->{errors}}) { my $s = $e->fullpkgpath; - if (defined $e->{host}) { + if (defined $e->{host} && !$e->{host}->is_localhost) { $s .= "(".$e->{host}->name.")"; } push(@l, $s);