Skip to content

Commit

Permalink
fix logic in _suggested_links():
Browse files Browse the repository at this point in the history
+ never return any suggested links when the plugin shouldn't be installed.
+ correctly handle SNMP plugins whose only wildcard parameter is the host.  (thanks to janl for spotting this was broken.)
  • Loading branch information
Matthew Boyle committed Nov 12, 2009
1 parent f80286d commit dc937c4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions node/lib/Munin/Node/Configure/Plugin.pm
Expand Up @@ -130,11 +130,15 @@ sub _installed_links { return (shift)->{installed}; }
sub _suggested_links
{
my ($self) = @_;
if ($self->{default} eq 'yes' and not $self->is_wildcard) {
return [ $self->{name} ];

# no suggestions if there isn't any
return [] if $self->{default} ne 'yes';

if ($self->is_wildcard or $self->{name} =~ /^snmp__/) {
return [ map { $self->_expand_wildcard($_) } @{$self->{suggestions}} ];
}
else {
return [ map { $self->_expand_wildcard($_) } @{$self->{suggestions}} ];
return [ $self->{name} ];
}
}

Expand Down

0 comments on commit dc937c4

Please sign in to comment.