When running the dynamic inventory script against a gce deployment , some nodes with external ips some without (running connecting through NAT ) i encounter this error when running list:
sh-3.2# ./inventory/gce/gce.py --list
Traceback (most recent call last):
File “./inventory/gce/gce.py”, line 287, in
GceInventory()
File “./inventory/gce/gce.py”, line 111, in init
print(self.json_format_dict(self.group_instances(),
File “./inventory/gce/gce.py”, line 242, in group_instances
meta[“hostvars”][name] = self.node_to_dict(node)
File “./inventory/gce/gce.py”, line 214, in node_to_dict
‘gce_public_ip’: inst.public_ips[0],
IndexError: list index out of range
only happens when there are nodes without external ips.When given temporary external ips the dynamic inventory proceeds as expected.Not sure if a bug in the gce.py script or elsewhere.