Allow 'deleted' to be passed through image update
The legacy client allowed users to pass 'deleted' through an update call. This is breaking some clients of this library because they expect to be be able to still do that. Fixes bug 1036315 Change-Id: I9ae20a5e4579240c7d5e86316d6d1e927755dbf5
This commit is contained in:
@@ -24,7 +24,11 @@ from glanceclient.common import utils
|
||||
|
||||
UPDATE_PARAMS = ('name', 'disk_format', 'container_format', 'min_disk',
|
||||
'min_ram', 'owner', 'size', 'is_public', 'protected',
|
||||
'location', 'checksum', 'copy_from', 'properties')
|
||||
'location', 'checksum', 'copy_from', 'properties',
|
||||
#NOTE(bcwaldon: an attempt to update 'deleted' will be
|
||||
# ignored, but we need to support it for backwards-
|
||||
# compatibility with the legacy client library
|
||||
'deleted')
|
||||
|
||||
CREATE_PARAMS = UPDATE_PARAMS + ('id',)
|
||||
|
||||
|
||||
@@ -362,6 +362,7 @@ class ImageManagerTest(unittest.TestCase):
|
||||
'min_disk': 10,
|
||||
'copy_from': 'http://example.com',
|
||||
'properties': {'a': 'b', 'c': 'd'},
|
||||
'deleted': False,
|
||||
}
|
||||
image = self.mgr.update('1', **fields)
|
||||
expect_hdrs = {
|
||||
@@ -375,6 +376,7 @@ class ImageManagerTest(unittest.TestCase):
|
||||
'x-glance-api-copy-from': 'http://example.com',
|
||||
'x-image-meta-property-a': 'b',
|
||||
'x-image-meta-property-c': 'd',
|
||||
'x-image-meta-deleted': 'False',
|
||||
}
|
||||
expect = [('PUT', '/v1/images/1', expect_hdrs, None)]
|
||||
self.assertEqual(self.api.calls, expect)
|
||||
|
||||
Reference in New Issue
Block a user