Remove OpenStack driver waitForImage call

This doesn't appear to be used.

Change-Id: I8568d59b1f54f3ddd826080bf4502adeada7d01f
This commit is contained in:
David Shrewsbury 2018-07-05 16:04:45 -04:00 committed by Monty Taylor
parent b11516ae24
commit 87bbe26ab5
No known key found for this signature in database
GPG Key ID: 7BAE94BC7141A594

View File

@ -25,7 +25,6 @@ from nodepool import exceptions
from nodepool.driver import Provider
from nodepool.driver.utils import QuotaInformation
from nodepool.nodeutils import iterate_timeout
from nodepool.task_manager import ManagerStoppedException
from nodepool.task_manager import TaskManager
from nodepool import version
@ -348,43 +347,6 @@ class OpenStackProvider(Provider):
if not self.getServer(server_id):
return
def waitForImage(self, image_id, timeout=3600):
last_status = None
for count in iterate_timeout(
timeout, exceptions.ImageCreateException, "image creation"):
try:
image = self.getImage(image_id)
except exceptions.NotFound:
continue
except ManagerStoppedException:
raise
except Exception:
self.log.exception('Unable to list images while waiting for '
'%s will retry' % (image_id))
continue
# shade returns None when not found
if not image:
continue
status = image['status']
if (last_status != status):
self.log.debug(
'Status of image in {provider} {id}: {status}'.format(
provider=self.provider.name,
id=image_id,
status=status))
if status == 'ERROR' and 'fault' in image:
self.log.debug(
'ERROR in {provider} on {id}: {resason}'.format(
provider=self.provider.name,
id=image_id,
resason=image['fault']['message']))
last_status = status
# Glance client returns lower case statuses - but let's be sure
if status.lower() in ['active', 'error']:
return image
def createImage(self, server, image_name, meta):
return self._client.create_image_snapshot(
image_name, server, **meta)