diff options
| author | Cory Wright <cory.wright@rackspace.com> | 2010-12-30 17:43:01 -0500 |
|---|---|---|
| committer | Cory Wright <cory.wright@rackspace.com> | 2010-12-30 17:43:01 -0500 |
| commit | 918a2f4440d6299bd073389e62650af163091eab (patch) | |
| tree | 46e84b288d70b1ea022c27730aa6dfe7814e523f /nova/api | |
| parent | 384f39966b6387fcc9466f0b42bcc0ffaf49ba4c (diff) | |
| parent | 3bace9ab20c2ba10f638dd8613ea5e05c4efbeec (diff) | |
merge trunk
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/auth.py | 3 | ||||
| -rw-r--r-- | nova/api/openstack/images.py | 10 |
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 |
