This commit is contained in:
Cerberus
2010-12-28 15:48:48 -06:00
parent 31d3aed581
commit 902df6eb49
2 changed files with 7 additions and 12 deletions

View File

@@ -23,7 +23,7 @@ from nova.api.openstack import faults
import nova.image.service import nova.image.service
def _entity_inst(inst): def _translate_keys(inst):
""" Coerces the backup schedule into proper dictionary format """ """ Coerces the backup schedule into proper dictionary format """
return dict(backupSchedule=inst) return dict(backupSchedule=inst)
@@ -41,7 +41,7 @@ class Controller(wsgi.Controller):
def index(self, req, server_id): def index(self, req, server_id):
""" Returns the list of backup schedules for a given instance """ """ Returns the list of backup schedules for a given instance """
return _entity_inst({}) return _translate_keys({})
def create(self, req, server_id): def create(self, req, server_id):
""" No actual update method required, since the existing API allows """ No actual update method required, since the existing API allows

View File

@@ -21,17 +21,12 @@ from nova import wsgi
from nova.api.openstack import faults from nova.api.openstack import faults
def _entity_list(entities): def _translate_keys(inst):
""" Coerces a list of shared IP groups into proper dictionary format """
return dict(sharedIpGroups=entities)
def _entity_inst(inst):
""" Coerces a shared IP group instance into proper dictionary format """ """ Coerces a shared IP group instance into proper dictionary format """
return dict(sharedIpGroup=inst) return dict(sharedIpGroup=inst)
def _entity_detail(inst): def _translate_detail_keys(inst):
""" Coerces a shared IP group instance into proper dictionary format with """ Coerces a shared IP group instance into proper dictionary format with
correctly mapped attributes """ correctly mapped attributes """
return dict(sharedIpGroup=inst) return dict(sharedIpGroup=inst)
@@ -47,11 +42,11 @@ class Controller(wsgi.Controller):
def index(self, req): def index(self, req):
""" Returns a list of Shared IP Groups for the user """ """ Returns a list of Shared IP Groups for the user """
return _entity_list([]) return dict(sharedIpGroups=[])
def show(self, req, id): def show(self, req, id):
""" Shows in-depth information on a specific Shared IP Group """ """ Shows in-depth information on a specific Shared IP Group """
return _entity_inst({}) return _translate_keys({})
def update(self, req, id): def update(self, req, id):
""" You can't update a Shared IP Group """ """ You can't update a Shared IP Group """
@@ -63,7 +58,7 @@ class Controller(wsgi.Controller):
def detail(self, req, id): def detail(self, req, id):
""" Returns a complete list of Shared IP Groups """ """ Returns a complete list of Shared IP Groups """
return _entity_detail({}) return _translate_detail_keys({})
def create(self, req): def create(self, req):
""" Creates a new Shared IP group """ """ Creates a new Shared IP group """