summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorJosh Kearney <josh.kearney@rackspace.com>2010-12-30 15:23:14 -0600
committerJosh Kearney <josh.kearney@rackspace.com>2010-12-30 15:23:14 -0600
commitc107e96c2aa16be5106c13528bcfb3d9b5f90103 (patch)
tree6b45b536404d4541224dae3b5ae3e3ef89e8a066 /nova/api
parent42f6a993bcc4d0bc8823e4d039b1f59a6d6758a8 (diff)
parentac6fd2290febed0238b67ac0cd83b220cdbd3efc (diff)
downloadnova-c107e96c2aa16be5106c13528bcfb3d9b5f90103.tar.gz
nova-c107e96c2aa16be5106c13528bcfb3d9b5f90103.tar.xz
nova-c107e96c2aa16be5106c13528bcfb3d9b5f90103.zip
Merged trunk
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/auth.py3
-rw-r--r--nova/api/openstack/images.py10
2 files changed, 8 insertions, 5 deletions
diff --git a/nova/api/openstack/auth.py b/nova/api/openstack/auth.py
index e24e58fd3..1dfdd5318 100644
--- a/nova/api/openstack/auth.py
+++ b/nova/api/openstack/auth.py
@@ -55,7 +55,8 @@ class AuthMiddleware(wsgi.Middleware):
if not user:
return faults.Fault(webob.exc.HTTPUnauthorized())
- req.environ['nova.context'] = context.RequestContext(user, user)
+ project = self.auth.get_project(FLAGS.default_project)
+ req.environ['nova.context'] = context.RequestContext(user, project)
return self.application
def has_authentication(self, req):
diff --git a/nova/api/openstack/images.py b/nova/api/openstack/images.py
index ba35fbc78..867ee5a7e 100644
--- a/nova/api/openstack/images.py
+++ b/nova/api/openstack/images.py
@@ -25,7 +25,7 @@ import nova.image.service
from nova.api.openstack import common
from nova.api.openstack import faults
-
+from nova.compute import api as compute_api
FLAGS = flags.FLAGS
@@ -127,9 +127,11 @@ class Controller(wsgi.Controller):
raise faults.Fault(exc.HTTPNotFound())
def create(self, req):
- # Only public images are supported for now, so a request to
- # make a backup of a server cannot be supproted.
- raise faults.Fault(exc.HTTPNotFound())
+ context = req.environ['nova.context']
+ env = self._deserialize(req.body, req)
+ instance_id = env["image"]["serverId"]
+ name = env["image"]["name"]
+ return compute_api.ComputeAPI().snapshot(context, instance_id, name)
def update(self, req, id):
# Users may not modify public images, and that's all that