From 62dbda330bf499588ecbeaa12be913453d0d35c1 Mon Sep 17 00:00:00 2001 From: hejiawei Date: Thu, 1 Dec 2016 15:20:02 +0800 Subject: [PATCH] Fix the inconsistency about some parameters regarding to pod 1.What is the problem? Naming of some parameter regarding pod is a little bit different. This inconsistency has to be fixed out as much as possible 2.What is the solution to the problem? Rename the inconsistent parameter. 3.What the features need to be implemented to the Tricircle to realize the solution? No new features. Change-Id: Ib9515aea84b9dfa1492a64ddf9bb60103df75500 Closes-Bug: #1583436 --- trio2o/nova_apigw/controllers/server.py | 5 +++-- trio2o/nova_apigw/controllers/volume.py | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) 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]