Skip to content

Commit

Permalink
cleanup code
Browse files Browse the repository at this point in the history
  • Loading branch information
Antoine Amacher committed May 30, 2017
1 parent 712a91d commit 7112468
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use pf::util;
use pf::error qw(is_success);
use pf::web;
use pf::enforcement qw(reevaluate_access);
use fingerbank::DB_Factory;

BEGIN { extends 'captiveportal::Base::Controller'; }

Expand Down Expand Up @@ -212,15 +213,12 @@ sub device_from_mac_vendor {
my $logger = get_logger();

for my $schema (("Local", "Upstream")) {
use fingerbank::DB_Factory;
my $db = fingerbank::DB_Factory->instantiate(schema => $schema);
my $view_class = "fingerbank::Schema::".$schema."::CombinationMacVendorByDevice";
my $bind_params = $view_class->view_bind_params([$mac_vendor_id]);
my $result = $db->handle->resultset('CombinationMacVendorByDevice')->search({}, { bind => $bind_params })->first;
if ($result) {
my $device_id = $result->device_id;
use Data::Dumper;
$logger->info('result' . Dumper($result));
$logger->info("Found $device_id for MAC vendor $mac_vendor_id");
return $device_id;
}
Expand Down

0 comments on commit 7112468

Please sign in to comment.