also store master neighbor port
This commit is contained in:
@@ -793,6 +793,8 @@ sub store_neighbors {
|
|||||||
|
|
||||||
$master->update({
|
$master->update({
|
||||||
remote_ip => $remote_ip,
|
remote_ip => $remote_ip,
|
||||||
|
remote_port =>
|
||||||
|
($portrow->neighbor_port ? $portrow->neighbor_port->slave_of : undef),
|
||||||
is_uplink => \"true",
|
is_uplink => \"true",
|
||||||
manual_topo => \"false",
|
manual_topo => \"false",
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -199,6 +199,22 @@ __PACKAGE__->belongs_to(
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
=head2 neighbor_port
|
||||||
|
|
||||||
|
Returns another row from the C<device_port> table if this port has valid
|
||||||
|
C<remote_ip> and C<remote_port>.
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
|
__PACKAGE__->belongs_to(
|
||||||
|
neighbor_port => 'App::Netdisco::DB::Result::DevicePort', {
|
||||||
|
'foreign.ip' => 'self.remote_ip',
|
||||||
|
'foreign.port' => 'self.remote_port',
|
||||||
|
}, {
|
||||||
|
join_type => 'LEFT',
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
=head2 neighbor_alias
|
=head2 neighbor_alias
|
||||||
|
|
||||||
When a device port has an attached neighbor device, this relationship will
|
When a device port has an attached neighbor device, this relationship will
|
||||||
|
|||||||
Reference in New Issue
Block a user