remove unecessary defining of DBIC attrs

This commit is contained in:
Oliver Gorwits
2012-02-21 22:19:48 +00:00
parent e4cd6a6eee
commit aad35e13e1
5 changed files with 0 additions and 17 deletions

View File

@@ -165,8 +165,6 @@ preformatted timestamps of the C<time_first> and C<time_last> 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({}, {

View File

@@ -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({}, {

View File

@@ -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)

View File

@@ -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({}, {

View File

@@ -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;