Merge "Fix the inconsistency about some parameters regarding to pod"

This commit is contained in:
Jenkins 2016-12-05 03:37:18 +00:00 committed by Gerrit Code Review
commit 3bf386087d
2 changed files with 5 additions and 4 deletions

View File

@ -201,7 +201,7 @@ class ServerController(rest.RestController):
pecan.response.status = 204
return pecan.response
def _get_or_create_route(self, context, pod, _id, _type):
def _get_or_create_route(self, context, pod_name, _id, _type):
def list_resources(t_ctx, q_ctx, pod_, ele, _type_):
client = self._get_client(pod_['pod_name'])
return client.list_resources(_type_, t_ctx, [{'key': 'name',
@ -209,7 +209,8 @@ class ServerController(rest.RestController):
'value': ele['id']}])
return t_lock.get_or_create_route(context, None,
self.project_id, pod, {'id': _id},
self.project_id,
pod_name, {'id': _id},
_type, list_resources)
@staticmethod

View File

@ -35,9 +35,9 @@ class VolumeController(rest.RestController):
def __init__(self, project_id, server_id):
self.project_id = project_id
self.server_id = server_id
self.clients = {'top': t_client.Client()}
self.clients = {constants.TOP: t_client.Client()}
def _get_client(self, pod_name='top'):
def _get_client(self, pod_name=constants.TOP):
if pod_name not in self.clients:
self.clients[pod_name] = t_client.Client(pod_name)
return self.clients[pod_name]