Uploaded image for project: 'Libcloud'
  1. Libcloud
  2. LIBCLOUD-1045

List inventory fails if GCP has an instance in SUSPENDED state

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.4.0
    • None
    • Compute
    • 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'

      Attachments

        Activity

          People

            kami Tomaz Muraus
            rafa.alistair rafa alistair
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: