From 99b908a64ff31d2c4fd99d95a93c96cfdf8f7bbc Mon Sep 17 00:00:00 2001 From: Duncan Ferguson Date: Thu, 17 Nov 2011 22:51:54 +0000 Subject: [PATCH] Make use of find_binary if not set in config If comms command isnt set then find the path to the binary --- lib/App/ClusterSSH/Config.pm | 4 ++++ t/15config.t | 2 ++ 2 files changed, 6 insertions(+) diff --git a/lib/App/ClusterSSH/Config.pm b/lib/App/ClusterSSH/Config.pm index 4753096..c0966dd 100644 --- a/lib/App/ClusterSSH/Config.pm +++ b/lib/App/ClusterSSH/Config.pm @@ -86,6 +86,10 @@ sub new { $self->{comms} = 'ssh'; } + if($self->{comms} && (! $self->{ $self->{comms} } || ! -e $self->{ $self->{comms} } ) ) { + $self->{ $self->{comms} } = $self->find_binary( $self->{ comms } ); + } + $self->{title} = uc($Script); return $self->validate_args(%args); diff --git a/t/15config.t b/t/15config.t index 34621f3..8f1c4cc 100644 --- a/t/15config.t +++ b/t/15config.t @@ -56,6 +56,8 @@ Readonly::Hash my %default_config => { terminal_decoration_height => 10, terminal_decoration_width => 8, + ssh => '/usr/bin/ssh', + rsh_args => "", telnet_args => "", ssh_args => "",