From 0fcd558c45e5648118eb9d00043a91ac19f2790d Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Sat, 19 Oct 2013 19:07:47 +0100 Subject: [PATCH] fix minor issue with locking rows for macsuck update --- Netdisco/lib/App/Netdisco/Core/Macsuck.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Netdisco/lib/App/Netdisco/Core/Macsuck.pm b/Netdisco/lib/App/Netdisco/Core/Macsuck.pm index 39dda17a..35838efa 100644 --- a/Netdisco/lib/App/Netdisco/Core/Macsuck.pm +++ b/Netdisco/lib/App/Netdisco/Core/Macsuck.pm @@ -129,6 +129,7 @@ field of the database record. If not provided, it defauls to C. sub store_node { my ($ip, $vlan, $port, $mac, $now) = @_; $now ||= 'now()'; + $vlan ||= 0; schema('netdisco')->txn_do(sub { my $nodes = schema('netdisco')->resultset('Node'); @@ -157,13 +158,13 @@ sub store_node { my $new = $nodes->search({ 'me.switch' => $ip, 'me.port' => $port, + 'me.vlan' => $vlan, 'me.mac' => $mac, }); # new data $new->update_or_create( { - vlan => $vlan, active => \'true', oui => substr($mac,0,8), time_last => \$now,