summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorWilliam Wolf <throughnothing@gmail.com>2011-06-06 14:55:04 -0400
committerWilliam Wolf <throughnothing@gmail.com>2011-06-06 14:55:04 -0400
commit51f4b673d9521f43b2396eeb7d65cd43d1f100b6 (patch)
tree0c46761ba4e237d35b546b2eb66f5c78800c4b04 /nova/api
parent78611b6a002095747ea41e26029cdea5aeb753f7 (diff)
parent4d50e840c7a9dd30cda0670564ad0135027f2ba5 (diff)
merge from trunk, resolved conflicts
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/images.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/nova/api/openstack/images.py b/nova/api/openstack/images.py
index 32ac9d2f1..5ffd8e96a 100644
--- a/nova/api/openstack/images.py
+++ b/nova/api/openstack/images.py
@@ -99,7 +99,7 @@ class Controller(object):
raise webob.exc.HTTPBadRequest()
try:
- server_id = body["image"]["serverId"]
+ server_id = self._server_id_from_req_data(body)
image_name = body["image"]["name"]
except KeyError:
raise webob.exc.HTTPBadRequest()
@@ -111,6 +111,9 @@ class Controller(object):
"""Indicates that you must use a Controller subclass."""
raise NotImplementedError
+ def _server_id_from_req_data(self, data):
+ raise NotImplementedError()
+
class ControllerV10(Controller):
"""Version 1.0 specific controller logic."""
@@ -146,6 +149,9 @@ class ControllerV10(Controller):
builder = self.get_builder(req).build
return dict(images=[builder(image, detail=True) for image in images])
+ def _server_id_from_req_data(self, data):
+ return data['image']['serverId']
+
class ControllerV11(Controller):
"""Version 1.1 specific controller logic."""
@@ -183,6 +189,9 @@ class ControllerV11(Controller):
builder = self.get_builder(req).build
return dict(images=[builder(image, detail=True) for image in images])
+ def _server_id_from_req_data(self, data):
+ return data['image']['serverRef']
+
def create_resource(version='1.0'):
controller = {
@@ -198,7 +207,7 @@ def create_resource(version='1.0'):
metadata = {
"attributes": {
"image": ["id", "name", "updated", "created", "status",
- "serverId", "progress"],
+ "serverId", "progress", "serverRef"],
"link": ["rel", "type", "href"],
},
}