~eday/nova/pep8-fixes-db

« back to all changes in this revision

Viewing changes to nova/api/__init__.py

  • Committer: Eric Day
  • Date: 2010-10-21 22:26:06 UTC
  • Revision ID: eday@oddments.org-20101021222606-9r8hxuadtmzk9o8n
PEP8 cleanup in nova/api. There should be no functional changes here, just style changes to get violations down.

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
from nova.api.ec2 import metadatarequesthandler
32
32
 
33
33
 
34
 
flags.DEFINE_string('osapi_subdomain', 'api', 
 
34
flags.DEFINE_string('osapi_subdomain', 'api',
35
35
                    'subdomain running the OpenStack API')
36
 
flags.DEFINE_string('ec2api_subdomain', 'ec2', 
 
36
flags.DEFINE_string('ec2api_subdomain', 'ec2',
37
37
                    'subdomain running the EC2 API')
38
 
flags.DEFINE_string('FAKE_subdomain', None, 
39
 
                    'set to api or ec2 to fake the subdomain of the host for testing')
 
38
flags.DEFINE_string('FAKE_subdomain', None,
 
39
                    'set to api or ec2 to fake the subdomain of the host '
 
40
                    'for testing')
40
41
FLAGS = flags.FLAGS
41
42
 
42
43
 
44
45
    """Routes top-level requests to the appropriate controller."""
45
46
 
46
47
    def __init__(self):
47
 
        osapidomain =  {'sub_domain': [FLAGS.osapi_subdomain]}
 
48
        osapidomain = {'sub_domain': [FLAGS.osapi_subdomain]}
48
49
        ec2domain = {'sub_domain': [FLAGS.ec2api_subdomain]}
49
50
        # If someone wants to pretend they're hitting the OSAPI subdomain
50
51
        # on their local box, they can set FAKE_subdomain to 'api', which
55
56
            ec2domain = {}
56
57
        mapper = routes.Mapper()
57
58
        mapper.sub_domains = True
58
 
        mapper.connect("/", controller=self.osapi_versions, 
 
59
        mapper.connect("/", controller=self.osapi_versions,
59
60
                            conditions=osapidomain)
60
61
        mapper.connect("/v1.0/{path_info:.*}", controller=openstack.API(),
61
62
                            conditions=osapidomain)
107
108
            '2009-04-04',
108
109
        ]
109
110
        return ''.join('%s\n' % v for v in versions)
110
 
 
111