From 3fdf7802b69b67c9421633e266238fd8a292a230 Mon Sep 17 00:00:00 2001 From: "Eric A. Miller" Date: Tue, 14 Jan 2014 22:11:05 -0500 Subject: [PATCH] #76 Don't include wireless in ports with multiple nodes attached report --- Netdisco/Changes | 1 + .../App/Netdisco/Web/Plugin/Report/PortMultiNodes.pm | 12 +++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Netdisco/Changes b/Netdisco/Changes index 86811bce..90dd86f3 100644 --- a/Netdisco/Changes +++ b/Netdisco/Changes @@ -20,6 +20,7 @@ * Correct is_discoverable check in Undiscovered Neighbors report * Correct macsuck for Q-BRIDGE-MIB based devices * Allow cached SNMP community hint to override SNMP version cycle + * [#76] Don't include wireless in ports with multiple nodes attached report 2.021000 - 2014-01-08 diff --git a/Netdisco/lib/App/Netdisco/Web/Plugin/Report/PortMultiNodes.pm b/Netdisco/lib/App/Netdisco/Web/Plugin/Report/PortMultiNodes.pm index e0d9af15..f1fd8f28 100644 --- a/Netdisco/lib/App/Netdisco/Web/Plugin/Report/PortMultiNodes.pm +++ b/Netdisco/lib/App/Netdisco/Web/Plugin/Report/PortMultiNodes.pm @@ -16,10 +16,12 @@ register_report( get '/ajax/content/report/portmultinodes' => require_login sub { my @results = schema('netdisco')->resultset('Device')->search( - { 'ports.remote_ip' => undef, 'nodes.active' => 1 }, - { result_class => 'DBIx::Class::ResultClass::HashRefInflator', - select => [ 'ip', 'dns', 'name' ], - join => { 'ports' => 'nodes' }, + { 'ports.remote_ip' => undef, + 'nodes.active' => 1, + 'wireless.port' => undef + }, + { select => [ 'ip', 'dns', 'name' ], + join => { 'ports' => [ 'wireless', 'nodes' ] }, '+columns' => [ { 'port' => 'ports.port' }, { 'description' => 'ports.name' }, @@ -29,7 +31,7 @@ get '/ajax/content/report/portmultinodes' => require_login sub { having => \[ 'count(nodes.mac) > ?', [ count => 1 ] ], order_by => { -desc => [qw/count/] }, } - )->all; + )->hri->all; return unless scalar @results;