Skip Menu |

This queue is for tickets about the Net-Appliance-Session CPAN distribution.

Report information
The Basics
Id: 68899
Status: resolved
Priority: 0/
Queue: Net-Appliance-Session

People
Owner: OLIVER [...] cpan.org
Requestors: cvicente [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 3.111600
Fixed in: (no value)



Subject: Bug in parameter type constraint
Hi Oliver, While trying to use the constructor like this (following the documentation): my $s = Net::Appliance::Session->new( { host => $host, transport => $transport, personality => 'ios', connect_options => { shkc => 0, opts => [ '-o', "ConnectTimeout=$timeout", '-o', 'CheckHostIP=no', ], }, }); I was getting the following: Attribute (connect_options) does not pass the type constraint because: Validation failed for 'HashRef[Str]' with value HASH(0x5192080) at /usr/local/lib/perl/5.10.1/Moose/Meta/Attribute.pm line 1131 So I thought that perhaps that was too strict, so after applying the following patch, things worked as expected: --- Session.pm.old 2011-06-17 10:59:04.711939180 -0700 +++ Session.pm 2011-06-17 10:59:28.323192633 -0700 @@ -78,7 +78,7 @@ has 'connect_options' => ( is => 'ro', - isa => 'HashRef[Str]', + isa => 'HashRef', required => 0, default => sub { {} }, ); Debug output now shows: [0.005303] t command expands to: ssh -o StrictHostKeyChecking=no -o ConnectTimeout=30 -o CheckHostIP=no -l myusername router.uoregon.edu
Hi Carlos, First, many thanks for upgrading and running with the new API. You may also have noticed that the guts of the module are separated out into Net::CLI::Interact, which is much more capable than the earlier version. I'm truly grateful that you investigated this (and the other) error and sent in the patches. On Fri Jun 17 14:07:27 2011, CVICENTE wrote: Show quoted text
> Attribute (connect_options) does not pass the type constraint because: > Validation failed for > 'HashRef[Str]' with value HASH(0x5192080) at > /usr/local/lib/perl/5.10.1/Moose/Meta/Attribute.pm line 1131
This slipped through because I didn't have an SSH test included in the test suite. I've applied the patch and included a new SSH test. The updated code is released as version 3.111690: http://beta.metacpan.org/module/Net::Appliance::Session kindest regards, oliver.