rackspace/python-cloudlb — Issue #7: LBs virtualIPs property is no longer set 
Author: calebgroom
Created: 2011-12-30 16:37:57+00:00
State: open

python-cloudlb is no longer setting the virtualIPs property correctly. Here is how I duplicated the problem that I was seeing in https://github.com/calebgroom/clb. Two new Rackspace Cloud Servers, one Ubuntu 10.04 (Python 2.6.5) and one Ubuntu 11.10 (Python 2.7.2+). Configured with the following commands:

apt-get update && apt-get -y upgrade && apt-get -y install build-essential python-setuptools
# git package name is different between Ubuntu versions
apt-get -y install git; apt-get -y install git-core
mkdir code && cd code
git clone git://github.com/rackspace/python-cloudlb.git
cd python-cloudlb
python setup.py install

Here's the test script:

#!/usr/bin/python
import cloudlb
clb = cloudlb.CloudLoadBalancer("myuser", "myapikey","chicago")

lbs = clb.loadbalancers.list()
for lb in lbs:
print "%s has %s node attached with IP addresses:" % (lb.name, len(lb.nodes))
for ip in lb.virtualIps:
print "%s/%s" % (ip.ipVersion, ip.address)

Here's the failure:

# python test.py
python-cloudlb-test1 has 1 node attached with IP addresses:
Traceback (most recent call last):
File "test.py", line 8, in
for ip in lb.virtualIps:
File "/root/code/python-cloudlb/cloudlb/base.py", line 23, in __getattr__
raise AttributeError("Object has no attribute '%s'" % k)
AttributeError: Object has no attribute 'virtualIps'

However, I can tell that the API servers are returning IP data. You'll need [this patch](https://github.com/rackspace/python-cloudlb/pull/6) for all the debugging info. I've placed the output in [this gist](https://gist.github.com/1540517).