Skip Menu |

This queue is for tickets about the Net-Amazon-EC2 CPAN distribution.

Report information
The Basics
Id: 99909
Status: resolved
Priority: 0/
Queue: Net-Amazon-EC2

People
Owner: Nobody in particular
Requestors: j [...] dawnrazor.net
Cc:
AdminCc:

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



Subject: reboot_instances doesn't actually support array refs
Date: Thu, 30 Oct 2014 10:59:19 -0500
To: bug-net-amazon-ec2 [...] rt.cpan.org
From: J <j [...] dawnrazor.net>
Hello, The documentation states the following for the reboot_instances call: -- InstanceId (required) Instance Id of the instance you wish to reboot. Can be either a scalar or array ref of instances to reboot. -- when passing an array reference to reboot_instances as follows: -- 45 $params{InstanceId} = [split(/,/,$instance_id)]; -- I got the following back: -- The 'InstanceId' parameter ("ARRAY(0x801c945e8)") to Net::Amazon::EC2::reboot_instances was an 'arrayref', which is not one of the allowed types: scalar at /usr/local/lib/perl5/site_perl/5.16/Net/Amazon/EC2.pm line 3313. -- I found the following: -- 3313 my %args = validate( @_, { 3314 InstanceId => { type => SCALAR }, -- After looking at the code a bit, I changed line 3314 to: -- 3314 InstanceId => { type => SCALAR | ARRAYREF }, -- This produced results consistent with the documentation. It looks like there may be other cases of this issue with other calls, but I did not look too closely. Thanks, J
On Thu Oct 30 11:59:31 2014, j@dawnrazor.net wrote: Show quoted text
> > Hello, > > The documentation states the following for the reboot_instances call: > -- > InstanceId (required) > Instance Id of the instance you wish to reboot. Can be either a > scalar or array ref of instances to reboot. > --
Yeah a lot of that type checking code is just flat out wrong. I've been working on a branch to reduce/remove it because it mostly just causes problems (and not in a good way either.) Thanks for the report. It will be fixed in a future release.
On Thu Oct 30 11:59:31 2014, j@dawnrazor.net wrote: Show quoted text
> This produced results consistent with the documentation. It looks like > there may be other cases of this issue with other calls, but I did not > look too closely.
I'm going to be releasing 0.30 soon which addresses this issue. Thank you.