TT#38200 Switch to new perl ngcp.get_peername() function

Change-Id: I4a669b22484c3b990ad0fc812201cd424226a96f
changes/37/21937/5
Guillem Jover 8 years ago
parent 1c5e435a1e
commit 1ecd9f92ac

@ -57,6 +57,17 @@ sub get_nodename
return $nodename;
}
sub get_peername
{
my ($self, $hostname) = @_;
if (not defined $self->{config}{hosts}{$hostname}) {
$hostname = 'self';
}
return $self->{config}{hosts}{$hostname}{peer};
}
1;
__END__
@ -96,6 +107,10 @@ Checks whether the $hostname node has the $role.
Returns the nodename of the node calling this function.
=item $peername = $t->get_peername($hostname)
Returns the peer name for a given $hostname.
=back
=head1 AUTHOR

@ -6,9 +6,6 @@
# @param argv.host The hostname to get the peername for.
# @return out The peername.
IF !hosts.${argv.host}.defined;
argv.host = 'self';
END;
out = hosts.${argv.host}.peer;
out = ngcp.get_peername(argv.host);
-%]

Loading…
Cancel
Save