Rename rpcapi to ticket_api

rpcapi is not the real one for all rpc calls.
It's only for ticket.So rename it.

Change-Id: I138332fc096f6827199ceba6ce7f5a0f792a62e0
This commit is contained in:
xuan.mingyi 2015-11-11 03:38:06 +00:00
parent 9c87af0bfc
commit ce96818ff1
2 changed files with 4 additions and 3 deletions

View File

@ -22,13 +22,13 @@ class Controller(rest.RestController):
@pecan.expose('json')
def post(self, **kwargs):
ticket = pecan.request.rpcapi.ticket_create(
ticket = pecan.request.ticket_api.ticket_create(
name=kwargs['name'])
return ticket
@pecan.expose('json')
def get_all(self):
tickets = pecan.request.rpcapi.ticket_list()
tickets = pecan.request.ticket_api.ticket_list()
return tickets

View File

@ -77,4 +77,5 @@ class RPCHook(hooks.PecanHook):
"""Attach the rpcapi object to the request so controllers can get to it."""
def before(self, state):
state.request.rpcapi = ticket_api.API(context=state.request.context)
state.request.ticket_api = ticket_api.API(
context=state.request.context)