Fix perltidy test

This commit is contained in:
Duncan Ferguson 2017-03-16 22:30:41 +00:00
parent 3e3ed2c1cc
commit 7a08f3239e

View file

@ -37,21 +37,22 @@ sub new {
# load in ssh hostname for later use # load in ssh hostname for later use
if ( !%ssh_hostname_for || !$ssh_configs_read{ $self->{ssh_config} } ) { if ( !%ssh_hostname_for || !$ssh_configs_read{ $self->{ssh_config} } ) {
$self->read_ssh_file($self, $self->{ssh_config}); $self->read_ssh_file( $self, $self->{ssh_config} );
$self->debug( 5, 'Have the following ssh hostnames' ); $self->debug( 5, 'Have the following ssh hostnames' );
$self->debug( 5, ' "', $_, '"' ) foreach ( sort keys %ssh_hostname_for ); $self->debug( 5, ' "', $_, '"' )
foreach ( sort keys %ssh_hostname_for );
} }
return $self; return $self;
} }
sub read_ssh_file($$) { sub read_ssh_file($$) {
my ( $self ) = shift; my ($self) = shift;
my ( $filename ) = glob(shift); my ($filename) = glob(shift);
$self->debug(3, 'Reading SSH file: ', $filename); $self->debug( 3, 'Reading SSH file: ', $filename );
$ssh_configs_read{ $filename } = 1; $ssh_configs_read{$filename} = 1;
if ( open( my $ssh_config_fh, '<', $filename ) ) { if ( open( my $ssh_config_fh, '<', $filename ) ) {
while ( my $line = <$ssh_config_fh> ) { while ( my $line = <$ssh_config_fh> ) {
@ -70,8 +71,7 @@ sub read_ssh_file($$) {
close($ssh_config_fh); close($ssh_config_fh);
} }
else { else {
$self->debug( 3, 'Unable to read ', $self->debug( 3, 'Unable to read ', $filename, ': ', $!, $/ );
$filename, ': ', $!, $/ );
} }
} }