Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: etienne.michon [...] gmail.com
Cc:
AdminCc:

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



Subject: describe_availability_zones not working
Date: Wed, 28 Nov 2012 17:18:42 +0100
To: bug-Net-Amazon-EC2 [...] rt.cpan.org
From: Etienne Michon <etienne.michon [...] gmail.com>
Hi, Here is my environment: - Linux ic 3.2.0-26-generic #41-Ubuntu SMP Thu Jun 14 17:49:24 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux - perl v5.14.2 built for x86_64-linux-gnu-thread-multi - Net::Amazon::EC2 v0.21. I cannot use the last 0.22 version because it does not work. I tried to run a small code to describe the availability zone in my Eucalyptus. I get the following output when trying to run the describe_availability_zones method: ------------------------------------- Eucalyptus Walrus Attribute (region_name) does not pass the type constraint because: Validation failed for 'Str' with value undef at constructor Net::Amazon::EC2::AvailabilityZone::new (defined at /usr/local/share/perl/5.14.2/Net/Amazon/EC2/AvailabilityZone.pm line 41) line 41 Net::Amazon::EC2::AvailabilityZone::new('Net::Amazon::EC2::AvailabilityZone', 'zone_name', 'cluster-ic', 'zone_state', 130.79.192.211, 'region_name', undef, 'messages', undef) called at /usr/local/share/perl/5.14.2/Net/Amazon/EC2.pm line 1389 Net::Amazon::EC2::describe_availability_zones(undef) called at tmp.pl line 14 ------------------------------------- The code is the following: ------------------------------------- my $ec2 = Net::Amazon::EC2->new( AWSAccessKeyId => 'XXXX', SecretAccessKey => 'XXXX', region_name => 'Eucalyptus', base_url => 'http://127.0.0.1:8773/services/Eucalyptus', ); my $regions_ref = $ec2->describe_regions; for my $region(@$regions_ref) { print $region->region_name."\n"; } print $ec2->describe_availability_zones(); ------------------------------------- As you can see, the call to describe_regions is working while the one to describe_availability_zones is not. Am I doing something wrong or is it a bug? Thanks Best regads -- Etienne Michon
On Wed Nov 28 11:19:17 2012, etienne.michon@gmail.com wrote: Show quoted text
> Am I doing something wrong or is it a bug?
It's a problem with the type constraints, so it's a bug in Net::Amazon::EC2 Specifically, the problem is this Show quoted text
> Attribute (region_name) does not pass the type constraint because: > Validation failed for 'Str' with value undef at constructor > Net::Amazon::EC2::AvailabilityZone::new (defined at > /usr/local/share/perl/5.14.2/Net/Amazon/EC2/AvailabilityZone.pm line > 41) > line 41
Which means that Moose did not pass the type constraints set on the Availability Zone class. (It is expecting a string and it got an 'undef' value instead.) As I mentioned in another RT ticket I think it's time for the type constraints to come off the classes used internally to the project such as this one because they just cause more problems than they're worth. I just committed a patch on github for this (commit 7b6100e), so please grab the latest code from github https://github.com/mrallen1/net-amazon-ec2 and see if it improves things. Thanks.
Subject: Re: [rt.cpan.org #81513] describe_availability_zones not working
Date: Wed, 28 Nov 2012 17:43:41 +0100
To: bug-Net-Amazon-EC2 [...] rt.cpan.org
From: Etienne Michon <etienne.michon [...] gmail.com>
On Wed, Nov 28, 2012 at 5:31 PM, Mark Allen via RT < bug-Net-Amazon-EC2@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=81513 > > > On Wed Nov 28 11:19:17 2012, etienne.michon@gmail.com wrote:
> > Am I doing something wrong or is it a bug?
> > It's a problem with the type constraints, so it's a bug in Net::Amazon::EC2 > > Specifically, the problem is this >
> > Attribute (region_name) does not pass the type constraint because: > > Validation failed for 'Str' with value undef at constructor > > Net::Amazon::EC2::AvailabilityZone::new (defined at > > /usr/local/share/perl/5.14.2/Net/Amazon/EC2/AvailabilityZone.pm line > > 41) > > line 41
> > Which means that Moose did not pass the type constraints set on the > Availability Zone class. (It > is expecting a string and it got an 'undef' value instead.) > > As I mentioned in another RT ticket I think it's time for the type > constraints to come off the > classes used internally to the project such as this one because they just > cause more problems > than they're worth. > > I just committed a patch on github for this (commit 7b6100e), so please > grab the latest code > from github > > https://github.com/mrallen1/net-amazon-ec2 > > and see if it improves things. >
Ok thanks it solves my problem. If I find such problem in other place, can I send a pull request with the same solution? Or is it useless? Show quoted text
> > Thanks. >
Regards -- Etienne
On Wed Nov 28 11:44:11 2012, etienne.michon@gmail.com wrote: Show quoted text
> If I find such problem in other place, can I send a pull request with the > same solution? Or is it useless?
I always love getting pull requests :) If you hit another roadblock and you can fix it, please send me a pull request. Thank you. Mark P.S. I'm working on a branch called 'moo' which I will push shortly which refactors the code to use Moo (not full on Moose) and removes the type constraints from the objects returned by the code for API calls. I expect this code to not only be much faster to load/run but also to end these type constraint type problems.