Removing unreachable line from stage() method

In stage() method of v2 api, _restore() is called after raising
HTTPConflict exception, which won't be reachable in any case after
the exception is raised.

_restore() changes the image_status from 'uploading' to 'queued'
and  data staging would start from the beginning after new stage call
with same image-id even though staging data has already been loaded
to store.

Hence it seems there is no point in keeping that _restore() incase of
Duplicate exception is raised.

Change-Id: I317587bc1ba6544b722a11ae217a5d1212c96ce2
Closes-Bug: 1732077
This commit is contained in:
Pranali Deore 2017-11-14 11:31:02 +05:30
parent dc32afe4da
commit db4a83f8bc
1 changed files with 0 additions and 1 deletions

View File

@ -303,7 +303,6 @@ class ImageDataController(object):
except glance_store.Duplicate as e:
msg = _("The image %s has data on staging") % image_id
raise webob.exc.HTTPConflict(explanation=msg)
self._restore(image_repo, image)
except glance_store.StorageFull as e:
msg = _("Image storage media "