diff --git a/Netdisco/lib/Netdisco/DB/Result/NodeIp.pm b/Netdisco/lib/Netdisco/DB/Result/NodeIp.pm index 05e8b84e..7cbf5aab 100644 --- a/Netdisco/lib/Netdisco/DB/Result/NodeIp.pm +++ b/Netdisco/lib/Netdisco/DB/Result/NodeIp.pm @@ -165,8 +165,6 @@ preformatted timestamps of the C and C fields. sub ip_aliases { my ($row, $cond, $attrs) = @_; - $cond ||= {}; - $attrs ||= {}; my $rs = $row->node_ips({ip => { '!=' => $row->ip }}); $rs = $rs->search_rs({}, {'+columns' => 'dns'}) @@ -207,8 +205,6 @@ A JOIN is performed on the Device table and the Device DNS column prefetched. sub node_sightings { my ($row, $cond, $attrs) = @_; - $cond ||= {}; - $attrs ||= {}; return $row ->nodes({}, { diff --git a/Netdisco/lib/Netdisco/DB/ResultSet/Device.pm b/Netdisco/lib/Netdisco/DB/ResultSet/Device.pm index fea1d0f4..e86a2f33 100644 --- a/Netdisco/lib/Netdisco/DB/ResultSet/Device.pm +++ b/Netdisco/lib/Netdisco/DB/ResultSet/Device.pm @@ -28,8 +28,6 @@ will add the following additional synthesized columns to the result set: sub with_times { my ($rs, $cond, $attrs) = @_; - $cond ||= {}; - $attrs ||= {}; return $rs ->search_rs($cond, $attrs) @@ -117,7 +115,6 @@ sub search_by_field { die "condition parameter to search_by_field must be hashref\n" if ref {} ne ref $p or 0 == scalar keys %$p; - $attrs ||= {}; my $op = $p->{matchall} ? '-and' : '-or'; @@ -278,7 +275,6 @@ sub carrying_vlan { $cond->{'vlans.vlan'} = $cond->{vlan}; $cond->{'port_vlans.vlan'} = delete $cond->{vlan}; - $attrs ||= {}; return $rs ->search_rs($cond, @@ -328,7 +324,6 @@ sub carrying_vlan_name { if ref {} ne ref $cond or !exists $cond->{name}; $cond->{'vlans.description'} = { '-ilike' => $cond->{name} }; - $attrs ||= {}; return $rs ->search_rs({}, { diff --git a/Netdisco/lib/Netdisco/DB/ResultSet/DevicePort.pm b/Netdisco/lib/Netdisco/DB/ResultSet/DevicePort.pm index 2cd8b914..1679a195 100644 --- a/Netdisco/lib/Netdisco/DB/ResultSet/DevicePort.pm +++ b/Netdisco/lib/Netdisco/DB/ResultSet/DevicePort.pm @@ -21,8 +21,6 @@ will add the following additional synthesized columns to the result set: sub with_times { my ($rs, $cond, $attrs) = @_; - $cond ||= {}; - $attrs ||= {}; return $rs ->search_rs($cond, $attrs) @@ -52,8 +50,6 @@ will add the following additional synthesized columns to the result set: sub with_vlan_count { my ($rs, $cond, $attrs) = @_; - $cond ||= {}; - $attrs ||= {}; return $rs ->search_rs($cond, $attrs) diff --git a/Netdisco/lib/Netdisco/DB/ResultSet/Node.pm b/Netdisco/lib/Netdisco/DB/ResultSet/Node.pm index 916d2a43..eccaf8c8 100644 --- a/Netdisco/lib/Netdisco/DB/ResultSet/Node.pm +++ b/Netdisco/lib/Netdisco/DB/ResultSet/Node.pm @@ -45,7 +45,6 @@ sub search_by_mac { if ref {} ne ref $cond or !exists $cond->{mac}; $cond->{'me.mac'} = delete $cond->{mac}; - $attrs ||= {}; return $rs ->search_rs({}, { diff --git a/Netdisco/lib/Netdisco/DB/ResultSet/NodeIp.pm b/Netdisco/lib/Netdisco/DB/ResultSet/NodeIp.pm index 5158c2cc..6e0dcc54 100644 --- a/Netdisco/lib/Netdisco/DB/ResultSet/NodeIp.pm +++ b/Netdisco/lib/Netdisco/DB/ResultSet/NodeIp.pm @@ -73,7 +73,6 @@ sub search_by_ip { die "ip address required for search_by_ip\n" if ref {} ne ref $cond or !exists $cond->{ip}; - $attrs ||= {}; # handle either plain text IP or NetAddr::IP (/32 or CIDR) my ($op, $ip) = ('=', delete $cond->{ip}); @@ -140,7 +139,6 @@ sub search_by_dns { if ref {} ne ref $cond or !exists $cond->{dns}; $cond->{dns} = { '-ilike' => delete $cond->{dns} }; - $attrs ||= {}; return $rs ->search_rs({}, {'+columns' => 'dns'}) @@ -186,7 +184,6 @@ sub search_by_mac { die "mac address required for search_by_mac\n" if ref {} ne ref $cond or !exists $cond->{mac}; - $attrs ||= {}; $rs = $rs->search_rs({}, {'+columns' => 'dns'}) if $rs->has_dns_col;