Description
Hi,
I have found a bug in the GCE driver of apache libcloud (v 0.19) when executing the function .ex_create_multiple_nodes:
nodes = driver.ex_create_multiple_nodes(**args)
File "/usr/local/lib/python2.7/dist-packages/libcloud/compute/drivers/gce.py", line 2602, in ex_create_multiple_nodes
self._multi_create_node(status, node_attrs)
File "/usr/local/lib/python2.7/dist-packages/libcloud/compute/drivers/gce.py", line 4869, in _multi_create_node
ex_automatic_restart=node_attrs['ex_automatic_restart'])
File "/usr/local/lib/python2.7/dist-packages/libcloud/compute/drivers/gce.py", line 4711, in _create_node_req
ex_disk_type = self.ex_get_disktype(ex_disk_type)
File "/usr/local/lib/python2.7/dist-packages/libcloud/compute/drivers/gce.py", line 3932, in ex_get_disktype
request = '/zones/%s/diskTypes/%s' % (zone.name, name)
AttributeError: 'NoneType' object has no attribute 'name'
The problem is at function ex_get_disktype, because the parameter zone is "None".
I'm not sure if it is the correct solution but I solve this problem changing the line 4711 of the gce.py driver (_create_node_req function), adding the location parameter:
- From this:
ex_disk_type = self.ex_get_disktype(ex_disk_type)
- To this:
ex_disk_type = self.ex_get_disktype(ex_disk_type, location)
Best regards.