Merge lp:~jshepher/glance/lp813291 into lp:~hudson-openstack/glance/trunk
Proposed by
Justin Shepherd
Status: | Merged |
---|---|
Approved by: | Brian Waldon |
Approved revision: | 158 |
Merged at revision: | 156 |
Proposed branch: | lp:~jshepher/glance/lp813291 |
Merge into: | lp:~hudson-openstack/glance/trunk |
Diff against target: |
79 lines (+53/-1) 2 files modified
glance/registry/db/api.py (+6/-1) tests/functional/test_httplib2_api.py (+47/-0) |
To merge this branch: | bzr merge lp:~jshepher/glance/lp813291 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Brian Waldon (community) | Approve | ||
Jay Pipes (community) | Approve | ||
Review via email:
|
Description of the change
Added fix for Bug #813291: POST to /images setting x-image-meta-id to an already existing image id causes a 500 error.
I came up with about 3 or 4 different ways of resolving this bug, and all tests pass. Let me know if you think this should be resolved in a different way.
This branch also includes a test in tests/functiona
To post a comment you must log in.
Here are the other solutions i tried:
#2
=== modified file 'glance/ registry/ db/api. py' registry/ db/api. py 2011-07-20 04:11:54 +0000 registry/ db/api. py 2011-07-20 04:14:00 +0000
--- glance/
+++ glance/
@@ -92,10 +92,10 @@
def image_create( context, values): update( context, values, values['id'], False) update( context, values, None, False)
"""Create an image from the values dictionary."""
+ if 'id' in values:
+ return _image_
+ else:
+ return _image_
def image_update( context, image_id, values, purge_props=False):
======= ======= ======= ======= ======= ======= ======= ======= ======= ======= ======= ======= ======= ======= ==
#3
=== modified file 'glance/ registry/ db/api. py' registry/ db/api. py 2011-07-20 04:11:54 +0000 registry/ db/api. py 2011-07-20 04:15:01 +0000 pop('properties ', {})
--- glance/
+++ glance/
@@ -258,6 +255,9 @@
# not a dict.
properties = values.
+ if 'id' in values:
image_ ref = image_get(context, image_id, session=session)
+ image_id = values['id']
+
if image_id:
else: