~eday/nova/api-tests

« back to all changes in this revision

Viewing changes to nova/api/rackspace/controllers/base.py

  • Committer: Eric Day
  • Date: 2010-08-17 23:43:37 UTC
  • Revision ID: eday@oddments.org-20100817234337-61s6na8uilgmcb4o
In an effort to keep new and old API code separate, I've created a nova.api to put all new API code under. This means nova.endpoint only contains the old Tornado implementation. I also cleaned up a few pep8 and other style nits in the new API code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# vim: tabstop=4 shiftwidth=4 softtabstop=4
 
2
 
 
3
# Copyright 2010 OpenStack LLC.
 
4
# All Rights Reserved.
 
5
#
 
6
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
 
7
#    not use this file except in compliance with the License. You may obtain
 
8
#    a copy of the License at
 
9
#
 
10
#         http://www.apache.org/licenses/LICENSE-2.0
 
11
#
 
12
#    Unless required by applicable law or agreed to in writing, software
 
13
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 
14
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 
15
#    License for the specific language governing permissions and limitations
 
16
#    under the License.
 
17
 
1
18
from nova import wsgi
2
19
 
3
 
class BaseController(wsgi.Controller):
 
20
 
 
21
class Controller(wsgi.Controller):
 
22
    """TODO(eday): Base controller for all rackspace controllers. What is this
 
23
    for? Is this just Rackspace specific? """
 
24
 
4
25
    @classmethod
5
26
    def render(cls, instance):
6
27
        if isinstance(instance, list):
7
 
            return { cls.entity_name : cls.render(instance) }
 
28
            return {cls.entity_name: cls.render(instance)}
8
29
        else:
9
 
            return { "TODO": "TODO" }
 
30
            return {"TODO": "TODO"}