Comment 5 for bug 1241379

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (master)

Reviewed: https://review.openstack.org/59014
Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=0cbe012602c7d4240beaa2e4158e885a8ce7de5a
Submitter: Jenkins
Branch: master

commit 0cbe012602c7d4240beaa2e4158e885a8ce7de5a
Author: David Koo <email address hidden>
Date: Mon Jan 6 15:39:49 2014 +0800

    Restore image status on duplicate image upload

    Glance should not allow already uploaded images to be modified by
    another upload. Currently, when configured with the local filesystem
    backend, Glance prevents duplicate upload of an already uploaded image
    BUT it changes the image status to "saving".

    This commit adds a status transition state machine to the domain.Image
    class and modifies the domain.Image.status setter function to verify
    status transitions based on this state machine - only target states that
    can be reached from the image's current state are permitted.

    Tests have also been agumented to verify that the original image (meta)
    data does not change in case of a conflicting upload.

    Closes-Bug: #1241379

    Change-Id: I62c5acae4c29abf0691d8279b51c59008f9c0047