if we don't ssh to it, don't print the name either in errors, as requested by
landry@
This commit is contained in:
parent
aa9e54882f
commit
7439821562
@ -1,5 +1,5 @@
|
|||||||
# ex:ts=8 sw=4:
|
# 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 <espie@openbsd.org>
|
# Copyright (c) 2010 Marc Espie <espie@openbsd.org>
|
||||||
#
|
#
|
||||||
@ -46,6 +46,22 @@ sub fullname
|
|||||||
return $name;
|
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
|
# here, a "core" is an entity responsible for scheduling cpu, such as
|
||||||
# running a job, which is a collection of tasks.
|
# running a job, which is a collection of tasks.
|
||||||
@ -373,7 +389,7 @@ my $init = {};
|
|||||||
sub new
|
sub new
|
||||||
{
|
{
|
||||||
my ($class, $host, $prop) = @_;
|
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);
|
return $init->{localhost} //= DPB::Core::Local->new_noreg($host, $prop);
|
||||||
} else {
|
} else {
|
||||||
require DPB::Core::Distant;
|
require DPB::Core::Distant;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# ex:ts=8 sw=4:
|
# 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 <espie@openbsd.org>
|
# Copyright (c) 2010 Marc Espie <espie@openbsd.org>
|
||||||
#
|
#
|
||||||
@ -77,7 +77,7 @@ sub errors_string
|
|||||||
my @l = ();
|
my @l = ();
|
||||||
for my $e (@{$self->{errors}}) {
|
for my $e (@{$self->{errors}}) {
|
||||||
my $s = $e->fullpkgpath;
|
my $s = $e->fullpkgpath;
|
||||||
if (defined $e->{host}) {
|
if (defined $e->{host} && !$e->{host}->is_localhost) {
|
||||||
$s .= "(".$e->{host}->name.")";
|
$s .= "(".$e->{host}->name.")";
|
||||||
}
|
}
|
||||||
push(@l, $s);
|
push(@l, $s);
|
||||||
|
Loading…
Reference in New Issue
Block a user