Merge "Fix the inconsistency about some parameters regarding to pod"
This commit is contained in:
commit
3bf386087d
@ -201,7 +201,7 @@ class ServerController(rest.RestController):
|
|||||||
pecan.response.status = 204
|
pecan.response.status = 204
|
||||||
return pecan.response
|
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_):
|
def list_resources(t_ctx, q_ctx, pod_, ele, _type_):
|
||||||
client = self._get_client(pod_['pod_name'])
|
client = self._get_client(pod_['pod_name'])
|
||||||
return client.list_resources(_type_, t_ctx, [{'key': 'name',
|
return client.list_resources(_type_, t_ctx, [{'key': 'name',
|
||||||
@ -209,7 +209,8 @@ class ServerController(rest.RestController):
|
|||||||
'value': ele['id']}])
|
'value': ele['id']}])
|
||||||
|
|
||||||
return t_lock.get_or_create_route(context, None,
|
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)
|
_type, list_resources)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
@ -35,9 +35,9 @@ class VolumeController(rest.RestController):
|
|||||||
def __init__(self, project_id, server_id):
|
def __init__(self, project_id, server_id):
|
||||||
self.project_id = project_id
|
self.project_id = project_id
|
||||||
self.server_id = server_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:
|
if pod_name not in self.clients:
|
||||||
self.clients[pod_name] = t_client.Client(pod_name)
|
self.clients[pod_name] = t_client.Client(pod_name)
|
||||||
return self.clients[pod_name]
|
return self.clients[pod_name]
|
||||||
|
Loading…
Reference in New Issue
Block a user