Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
2.4.0
-
None
-
None
-
Production
Description
List inventory throws exception if Google Cloud Project has a Compute Instance in SUSPENDED state.
To reproduce, run the following against a GCP with one suspended Compute instance.
./gce.py --list
Error:
Traceback (most recent call last):
File "./environments/qride/gce.py", line 521, in <module>
GceInventory()
File "./environments/qride/gce.py", line 161, in _init_
self.do_api_calls_update_cache()
File "./environments/qride/gce.py", line 401, in do_api_calls_update_cache
data = self.group_instances(zones)
File "./environments/qride/gce.py", line 421, in group_instances
for node in self.list_nodes():
File "./environments/qride/gce.py", line 411, in list_nodes
all_nodes.extend(driver.list_nodes())
File "/Users/gaurav.kumar/.virtualenvs/ansible-qride/lib/python3.7/site-packages/libcloud/compute/drivers/gce.py", line 2525, in list_nodes
self._to_node(i, use_disk_cache=ex_use_disk_cache)
File "/Users/gaurav.kumar/.virtualenvs/ansible-qride/lib/python3.7/site-packages/libcloud/compute/drivers/gce.py", line 8809, in _to_node
state=self.NODE_STATE_MAP[node['status']],
KeyError: 'SUSPENDED'