Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: marc.heide [...] nsn.com
Cc:
AdminCc:

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



Subject: describe_tags cannot handle tags without a value
If you attach a tag without a value to an instance (so its just the key), describe_tags returns an error (debug output): GENERATED QUERY URL: http://eu-west-1.ec2.amazonaws.com $VAR1 = { 'xmlns' => 'http://ec2.amazonaws.com/doc/2011-01-01/', 'requestId' => '69c94a5a-3d0a-4b13-af9a-b078bc26ed4d', 'tagSet' => { 'item' => [ { 'resourceType' => 'instance', 'value' => {}, 'resourceId' => 'i-8090b2c9', 'key' => 'BLA' } ] } }; Attribute (value) does not pass the type constraint because: Validation failed for 'Maybe[Str]' with value HASH(0x2fd86a4) at C:/Perl/site/lib/Net/Amazon/EC2.pm line 2613 Net::Amazon::EC2::describe_tags(undef, 'Filter.Name', 'key', 'Filter.Value', 'BLA') called at P:/advantage_platform/cframe/prototype/ec2/ami-creation/createAmiPerl.pl line 103 main::findServerByTag('BLA') called at P:/advantage_platform/cframe/prototype/ec2/ami-creation/createAmiPerl.pl line 125 The problem is that 'value' is defined as a required attribute for ctor of Net::Amazon::EC2::DescribeTags class and cannot be empty as it is in this case. This is nasty, especially if you try to fetch all tags in your account.
We can improve this behavior. I agree it's not correct.
On Thu Mar 29 08:42:11 2012, runkel wrote: Show quoted text
> If you attach a tag without a value to an instance (so its just the > key), describe_tags returns an error (debug output): > > GENERATED QUERY URL: http://eu-west-1.ec2.amazonaws.com > > > > $VAR1 = { > 'xmlns' => 'http://ec2.amazonaws.com/doc/2011-01-01/', > 'requestId' => '69c94a5a-3d0a-4b13-af9a-b078bc26ed4d', > 'tagSet' => { > 'item' => [ > { > 'resourceType' => 'instance', > 'value' => {}, > 'resourceId' => 'i-8090b2c9', > 'key' => 'BLA' > } > ] > } > }; > > > Attribute (value) does not pass the type constraint because: Validation > failed for 'Maybe[Str]' with value HASH(0x2fd86a4) at > C:/Perl/site/lib/Net/Amazon/EC2.pm line 2613 > Net::Amazon::EC2::describe_tags(undef, 'Filter.Name', 'key', > 'Filter.Value', 'BLA') called at > P:/advantage_platform/cframe/prototype/ec2/ami-creation/createAmiPerl.pl > line 103 > main::findServerByTag('BLA') called at > P:/advantage_platform/cframe/prototype/ec2/ami-creation/createAmiPerl.pl > line 125 > > The problem is that 'value' is defined as a required attribute for ctor > of Net::Amazon::EC2::DescribeTags class and cannot be empty as it is in > this case. This is nasty, especially if you try to fetch all tags in > your account.
The problem is XML::Simple is turning empty elements into an empty hash instead of undef. That's been fixed in 0.19. Thanks for the report.
Just released 0.21