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

Compute, base.py: _wait_until_running fails for Rackspace

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.8.0
    • 0.10.1
    • None

    Description

      The Rackspace driver's list_nodes method will not include a brand new node right away. Therefore, the following code will fail when being called after deploy_node.

      while time.time() < end:
      nodes = self.list_nodes()
      nodes = list([n for n in nodes if n.uuid == node.uuid])

      if len(nodes) == 0:
      raise LibcloudError(value=('Booted node[%s] ' % node
      + 'is missing from list_nodes.'),
      driver=self)

      if len(nodes) > 1:
      raise LibcloudError(value=('Booted single node[%s], ' % node
      + 'but multiple nodes have same UUID'),
      driver=self)

      node = nodes[0]

      if (node.public_ips and node.state == NodeState.RUNNING):
      return node
      else:
      time.sleep(wait_period)
      continue

      I fixed this by rewriting it like this:

      while time.time() < end:
      nodes = self.list_nodes()
      nodes = list([n for n in nodes if n.uuid == node.uuid])

      if len(nodes) > 1:
      raise LibcloudError(value=('Booted single node[%s], ' % node
      + 'but multiple nodes have same UUID'),
      driver=self)

      if (len(nodes) == 1 and nodes[0].public_ips and nodes[0].state == NodeState.RUNNING):
      return nodes[0]
      else:
      time.sleep(wait_period)
      continue

      Attachments

        Activity

          People

            Unassigned Unassigned
            jouke.waleson Jouke Waleson
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: