~ttx/glance/cactus-final-version

« back to all changes in this revision

Viewing changes to glance/server.py

  • Committer: Tarmac
  • Author(s): jaypipes at gmail
  • Date: 2011-04-05 20:42:53 UTC
  • mfrom: (100.1.1 bug747799)
  • Revision ID: tarmac-20110405204253-2w2p75cq2susatd1
Ensure we don't ask the backend store to delete an image if the image is in a queued or saving state, since clearly the backend state has yet to completely store the image.

Show diffs side-by-side

added added

removed removed

Lines of Context:
450
450
        """
451
451
        image = self.get_image_meta_or_404(req, id)
452
452
 
453
 
        delete_from_backend(image['location'])
 
453
        # The image's location field may be None in the case
 
454
        # of a saving or queued image, therefore don't ask a backend
 
455
        # to delete the image if the backend doesn't yet store it.
 
456
        # See https://bugs.launchpad.net/glance/+bug/747799
 
457
        if image['location']:
 
458
            delete_from_backend(image['location'])
454
459
 
455
460
        registry.delete_image_metadata(self.options, id)
456
461