Skip to content

Commit

Permalink
update: fix use of undefined variable
Browse files Browse the repository at this point in the history
If address is only "ssh://host/" the $params var will not get set.

(Closes D#686090)
  • Loading branch information
Peter Palfrader authored and steveschnepp committed Aug 28, 2012
1 parent 3d587bb commit 8429895
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion master/lib/Munin/Master/Node.pm
Expand Up @@ -72,6 +72,9 @@ sub _do_connect {
my ($url, $params) = split(/ +/, $self->{address}, 2);
my $uri = new URI($url);

# If address is only "ssh://host/" $params will not get set
$params = "" unless defined $params;

# If the scheme is not defined, it's a plain host.
# Prefix it with munin:// to be able to parse it like others
$uri = new URI("munin://" . $url) unless $uri->scheme;
Expand Down Expand Up @@ -109,7 +112,7 @@ sub _do_connect {
} elsif ($uri->scheme eq "cmd") {
# local commands should ignore the username, url and host
my $local_cmd = $uri->path;
my $local_pipe_cmd = $local_cmd . (defined $params ? " $params" : "");
my $local_pipe_cmd = "$local_cmd $params";

# Open a triple pipe
use IPC::Open3;
Expand Down

0 comments on commit 8429895

Please sign in to comment.