~soren/nova/lp658257

« back to all changes in this revision

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

  • Committer: Tarmac
  • Author(s): mdietz
  • Date: 2010-10-08 21:18:37 UTC
  • mfrom: (332.2.4 rs_api_rename)
  • Revision ID: hudson@openstack.org-20101008211837-j9khriwzr28bdd2k
Renames every instance of "rackspace" in the API and test code base. Also includes a minor patch for the API Servers controller to use images correctly in the absence of Glance. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
#    under the License.
18
18
 
19
19
"""
20
 
WSGI middleware for Rackspace API controllers.
 
20
WSGI middleware for OpenStack API controllers.
21
21
"""
22
22
 
23
23
import json
31
31
from nova import flags
32
32
from nova import utils
33
33
from nova import wsgi
34
 
from nova.api.rackspace import faults
35
 
from nova.api.rackspace import backup_schedules
36
 
from nova.api.rackspace import flavors
37
 
from nova.api.rackspace import images
38
 
from nova.api.rackspace import ratelimiting
39
 
from nova.api.rackspace import servers
40
 
from nova.api.rackspace import sharedipgroups
 
34
from nova.api.openstack import faults
 
35
from nova.api.openstack import backup_schedules
 
36
from nova.api.openstack import flavors
 
37
from nova.api.openstack import images
 
38
from nova.api.openstack import ratelimiting
 
39
from nova.api.openstack import servers
 
40
from nova.api.openstack import sharedipgroups
41
41
from nova.auth import manager
42
42
 
43
43
 
44
44
FLAGS = flags.FLAGS
45
45
flags.DEFINE_string('nova_api_auth',
46
 
    'nova.api.rackspace.auth.BasicApiAuthManager', 
47
 
    'The auth mechanism to use for the Rackspace API implemenation')
 
46
    'nova.api.openstack.auth.BasicApiAuthManager', 
 
47
    'The auth mechanism to use for the OpenStack API implemenation')
48
48
 
49
49
class API(wsgi.Middleware):
50
 
    """WSGI entry point for all Rackspace API requests."""
 
50
    """WSGI entry point for all OpenStack API requests."""
51
51
 
52
52
    def __init__(self):
53
53
        app = AuthMiddleware(RateLimitingMiddleware(APIRouter()))
54
54
        super(API, self).__init__(app)
55
55
 
56
56
class AuthMiddleware(wsgi.Middleware):
57
 
    """Authorize the rackspace API request or return an HTTP Forbidden."""
 
57
    """Authorize the openstack API request or return an HTTP Forbidden."""
58
58
 
59
59
    def __init__(self, application):
60
60
        self.auth_driver = utils.import_class(FLAGS.nova_api_auth)()
145
145
 
146
146
class APIRouter(wsgi.Router):
147
147
    """
148
 
    Routes requests on the Rackspace API to the appropriate controller
 
148
    Routes requests on the OpenStack API to the appropriate controller
149
149
    and method.
150
150
    """
151
151