diff --git a/nodepool/driver/openstack/provider.py b/nodepool/driver/openstack/provider.py index 25b4e13d9..c1fc55130 100755 --- a/nodepool/driver/openstack/provider.py +++ b/nodepool/driver/openstack/provider.py @@ -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)