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.
Reviewed: https:/ /review. openstack. org/59014 /git.openstack. org/cgit/ openstack/ glance/ commit/ ?id=0cbe012602c 7d4240beaa2e415 8e885a8ce7de5a
Committed: https:/
Submitter: Jenkins
Branch: master
commit 0cbe012602c7d42 40beaa2e4158e88 5a8ce7de5a
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: I62c5acae4c29ab f0691d8279b51c5 9008f9c0047