Bug 1003093

Summary: boto allocate_address() allocates public IP address, put returns 'None' for Address.public_ip
Product: [Fedora] Fedora EPEL Reporter: apb18
Component: python-botoAssignee: Robert Scheck <redhat-bugzilla>
Status: CLOSED INSUFFICIENT_DATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: el6CC: apb18, apevec, gholms, redhat-bugzilla
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-26 23:11:40 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description apb18 2013-08-30 18:30:54 UTC
Description of problem:
boto.ec2.connection.allocate_address() is supposed to return an Address object that is populated with the IP addresses allocated.  In this case, I was trying to allocate an address from an ec2 connection to Eucalyptus.  It worked fine with version python-boto 2.5.2-3.  A recent update to 2.9.9-2 seems to display broken behaviour.  

After allocating an address via allocate_address() in using 2.9.9-2, the resulting Address object has 'None' for public_ip.  It looks like the call to Eucalyptus is actually successful, but the result is not being populated to the .public_ip attribute in the Address object returned to the user.  Everything works fine with the older 2.5.2-3 version

Version-Release number of selected component (if applicable):
python-boto-2.9.9-2.el6.noarch


How reproducible:
Allocate an address via boto.ec2.connection.allocate_address()


Steps to Reproduce:
1. Create an EC2 connection to a Eucalyptus service
2. Try to allocate an address via boto.ec2.connection.allocate_address()
3. Notice that the address has None for public_ip, even though the address was successfully allocated

Actual results:
# ec2 is open connection of type boto.ec2.connection
>>> addr = ec2.allocate_address()
>>> addr
Address:None
>>> print addr.public_ip
None

euca-describe-addresses shows that this actually did successfully allocate address in Eucalyptus.  That address just isn't returned



Expected results:
# ec2 is open connection of type boto.ec2.connection
>>> addr = ec2.allocate_address()
>>> addr
Address:123.45.67.89
>>> print addr.public_ip
123.45.67.89

Comment 1 Garrett Holmstrom 2013-09-05 17:19:37 UTC
With what version of eucalyptus did you notice this behavior?  Older versions like to mangle the XML they return when they receive requests with API versions newer than they understand, so that may be throwing boto's parsing off.

Comment 2 Garrett Holmstrom 2013-09-26 23:11:40 UTC
This seems to work for me, at least with eucalyptus 3.3.1.  If you need a patch to make things work with an older cloud please re-open this bug and include the debug output you get when you run boto.set_stream_logger("") and then the method that is failing.  That will hopefully provide enough info about what the server is replying with to work out exactly what is breaking things for you.