diff --git a/trio2o/nova_apigw/controllers/server.py b/trio2o/nova_apigw/controllers/server.py index 639b352..a9209a2 100644 --- a/trio2o/nova_apigw/controllers/server.py +++ b/trio2o/nova_apigw/controllers/server.py @@ -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 diff --git a/trio2o/nova_apigw/controllers/volume.py b/trio2o/nova_apigw/controllers/volume.py index 71a8f88..81cca5a 100644 --- a/trio2o/nova_apigw/controllers/volume.py +++ b/trio2o/nova_apigw/controllers/volume.py @@ -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]