~nova-coresec/nova/ppa-lucid

« back to all changes in this revision

Viewing changes to nova/api/ec2/__init__.py

  • Committer: Soren Hansen
  • Date: 2010-10-20 02:31:51 UTC
  • mfrom: (195.1.88 ubuntu-packaging)
  • Revision ID: soren.hansen@rackspace.com-20101020023151-pzo6st38dd8xdo81
Merge ubuntu packaging branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
import webob.exc
26
26
 
27
27
from nova import exception
 
28
from nova import context
28
29
from nova import flags
29
30
from nova import wsgi
30
 
from nova.api import context
31
31
from nova.api.ec2 import apirequest
32
32
from nova.api.ec2 import admin
33
33
from nova.api.ec2 import cloud
78
78
            raise webob.exc.HTTPForbidden()
79
79
 
80
80
        # Authenticated!
81
 
        req.environ['ec2.context'] = context.APIRequestContext(user, project)
 
81
        ctxt = context.RequestContext(user=user,
 
82
                                      project=project,
 
83
                                      remote_address=req.remote_addr)
 
84
        req.environ['ec2.context'] = ctxt
82
85
        return self.application
83
86
 
84
87
 
142
145
                'CreateKeyPair': ['all'],
143
146
                'DeleteKeyPair': ['all'],
144
147
                'DescribeSecurityGroups': ['all'],
 
148
                'AuthorizeSecurityGroupIngress': ['netadmin'],
 
149
                'RevokeSecurityGroupIngress': ['netadmin'],
145
150
                'CreateSecurityGroup': ['netadmin'],
146
151
                'DeleteSecurityGroup': ['netadmin'],
147
152
                'GetConsoleOutput': ['projectmanager', 'sysadmin'],