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