Skip to content

Commit

Permalink
Removing unreachable line from stage() method
Browse files Browse the repository at this point in the history
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
  • Loading branch information
PranaliDeore committed Nov 14, 2017
1 parent dc32afe commit db4a83f
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion glance/api/v2/image_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,6 @@ def _build_staging_store():
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 "
Expand Down

0 comments on commit db4a83f

Please sign in to comment.