diff --git a/sahara/service/quotas.py b/sahara/service/quotas.py index db372156..c6f911e5 100644 --- a/sahara/service/quotas.py +++ b/sahara/service/quotas.py @@ -193,7 +193,7 @@ def _get_cinder_limits(): avail_limits = {} cinder = cinder_client.client() lim = {} - for l in cinder.limits.get().absolute: + for l in b.execute_with_retries(cinder.limits.get).absolute: lim[l.name] = l.value avail_limits['volumes'] = _sub_limit(lim['maxTotalVolumes'], diff --git a/sahara/service/volumes.py b/sahara/service/volumes.py index ee56ba23..e97584ce 100644 --- a/sahara/service/volumes.py +++ b/sahara/service/volumes.py @@ -124,7 +124,7 @@ def _create_attach_volume(ctx, instance, size, volume_type, if volume_local_to_instance: kwargs['scheduler_hints'] = {'local_to_instance': instance.instance_id} - volume = cinder.client().volumes.create(**kwargs) + volume = b.execute_with_retries(cinder.client().volumes.create, **kwargs) conductor.append_volume(ctx, instance, volume.id) _await_available(volume) @@ -239,7 +239,7 @@ def _delete_volume(volume_id): LOG.debug("Deleting volume {volume}".format(volume=volume_id)) volume = cinder.get_volume(volume_id) try: - volume.delete() + b.execute_with_retries(volume.delete) except Exception: LOG.error(_LE("Can't delete volume {volume}").format( volume=volume.id)) diff --git a/sahara/utils/openstack/cinder.py b/sahara/utils/openstack/cinder.py index ff060dec..a5ede039 100644 --- a/sahara/utils/openstack/cinder.py +++ b/sahara/utils/openstack/cinder.py @@ -98,4 +98,4 @@ def check_cinder_exists(): def get_volume(volume_id): - return client().volumes.get(volume_id) + return base.execute_with_retries(client().volumes.get, volume_id)