From db09651b6b2d4b18ff51acfd7fdfe8a1ff6aa3e5 Mon Sep 17 00:00:00 2001 From: nanaboat Date: Mon, 20 Mar 2017 18:31:48 +0000 Subject: [PATCH] Inconsistency Description 1. What is the problem? This is not a bug fix but to attend naming inconstistency at this early stage of the project. 2. What is the solution for the problem? To correct and maintain a consistent naming sequence for project. 3. What features need to be implemented for Tricircle? None Change-Id: I84d6e2aa76f0e61f39f20cacf19fe6333d82aa1f Closes-Bug: #1571136 --- devstack/local.conf.sample | 3 +-- tricircle/api/controllers/pod.py | 6 +++--- tricircle/api/controllers/routing.py | 10 +++++----- tricircle/common/restapp.py | 4 ++-- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/devstack/local.conf.sample b/devstack/local.conf.sample index 45667bc2..ef4a567e 100644 --- a/devstack/local.conf.sample +++ b/devstack/local.conf.sample @@ -23,7 +23,6 @@ HOST_IP=127.0.0.1 # Specify port for central Neutron server # TRICIRCLE_NEUTRON_PORT=20001 -TRICIRCLE_START_SERVICES=True enable_plugin tricircle https://github.com/openstack/tricircle/ -disable_service horizon +# disable_service horizon diff --git a/tricircle/api/controllers/pod.py b/tricircle/api/controllers/pod.py index 5e780c74..58bb215d 100644 --- a/tricircle/api/controllers/pod.py +++ b/tricircle/api/controllers/pod.py @@ -23,7 +23,7 @@ from oslo_log import log as logging from oslo_utils import uuidutils import tricircle.common.context as t_context -import tricircle.common.exceptions as t_exc +import tricircle.common.exceptions as t_exceptions from tricircle.common.i18n import _ from tricircle.common.i18n import _LE from tricircle.common import policy @@ -125,7 +125,7 @@ class PodsController(rest.RestController): try: return {'pod': db_api.get_pod(context, _id)} - except t_exc.ResourceNotFound: + except t_exceptions.ResourceNotFound: pecan.abort(404, _('Pod not found')) return @@ -159,7 +159,7 @@ class PodsController(rest.RestController): core.delete_resource(context, models.Pod, _id) pecan.response.status = 200 return {} - except t_exc.ResourceNotFound: + except t_exceptions.ResourceNotFound: return Response(_('Pod not found'), 404) except Exception as e: LOG.exception(_LE('Failed to delete pod: %(pod_id)s,' diff --git a/tricircle/api/controllers/routing.py b/tricircle/api/controllers/routing.py index bfe07b5e..882d73cb 100644 --- a/tricircle/api/controllers/routing.py +++ b/tricircle/api/controllers/routing.py @@ -19,7 +19,7 @@ from oslo_log import log as logging from tricircle.common import constants import tricircle.common.context as t_context -import tricircle.common.exceptions as t_exc +import tricircle.common.exceptions as t_exceptions from tricircle.common.i18n import _ from tricircle.common.i18n import _LE from tricircle.common import policy @@ -135,7 +135,7 @@ class RoutingController(rest.RestController): try: return {'routing': db_api.get_resource_routing(context, _id)} - except t_exc.ResourceNotFound: + except t_exceptions.ResourceNotFound: return utils.format_api_error( 404, _('Resource routing not found')) @@ -149,7 +149,7 @@ class RoutingController(rest.RestController): try: db_api.get_resource_routing(context, _id) - except t_exc.ResourceNotFound: + except t_exceptions.ResourceNotFound: return utils.format_api_error(404, _('Resource routing not found')) try: @@ -172,7 +172,7 @@ class RoutingController(rest.RestController): try: db_api.get_resource_routing(context, _id) - except t_exc.ResourceNotFound: + except t_exceptions.ResourceNotFound: return utils.format_api_error(404, _('Resource routing not found')) @@ -203,7 +203,7 @@ class RoutingController(rest.RestController): try: # find the pod through the pod_id and verify whether it exists db_api.get_pod(context, new_pod_id) - except t_exc.ResourceNotFound: + except t_exceptions.ResourceNotFound: return utils.format_api_error( 400, _("The pod %(new_pod_id)s doesn't" " exist") % {'new_pod_id': new_pod_id}) diff --git a/tricircle/common/restapp.py b/tricircle/common/restapp.py index 99fe2715..40e4b14e 100644 --- a/tricircle/common/restapp.py +++ b/tricircle/common/restapp.py @@ -17,7 +17,7 @@ from oslo_config import cfg from oslo_middleware import request_id from oslo_service import service -from tricircle.common import exceptions as t_exc +from tricircle.common import exceptions as t_exceptions from tricircle.common.i18n import _ @@ -31,7 +31,7 @@ def auth_app(app): # version, passing "project" as empty string to bypass it app = auth_token.AuthProtocol(app, {'project': ''}) else: - raise t_exc.InvalidConfigurationOption( + raise t_exceptions.InvalidConfigurationOption( opt_name='auth_strategy', opt_value=cfg.CONF.auth_strategy) return app