From a714eade72d314be1ddaaa9fbec5e92d93d4f2be Mon Sep 17 00:00:00 2001 From: Trevor McCasland Date: Mon, 5 Dec 2016 07:56:24 -0600 Subject: [PATCH] Add i18n translation to extensions 2/3 This is patch 2 of 3 to add i18n translation to the extensions directory and some other files. Custom hacking rules will be added later to enforce this style. Change-Id: Ifdf426684473fb05cae63877c334e6cf65aa5234 --- trove/extensions/common/service.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/trove/extensions/common/service.py b/trove/extensions/common/service.py index 7866926610..9c702ff45e 100644 --- a/trove/extensions/common/service.py +++ b/trove/extensions/common/service.py @@ -25,6 +25,7 @@ from trove.cluster import models as cluster_models from trove.cluster.models import DBCluster from trove.common import cfg from trove.common import exception +from trove.common.i18n import _ from trove.common.i18n import _LI from trove.common import policy from trove.common import wsgi @@ -145,7 +146,7 @@ class ClusterRootController(DefaultRootController): is_root_enabled = models.ClusterRoot.load(context, instance_id) except exception.UnprocessableEntity: raise exception.UnprocessableEntity( - "Cluster %s is not ready." % instance_id) + _("Cluster %s is not ready.") % instance_id) return wsgi.Result(views.RootEnabledView(is_root_enabled).data(), 200) def cluster_root_index(self, req, tenant_id, cluster_id): @@ -225,7 +226,8 @@ class RootController(ExtensionController): return root_controller.root_create(req, body, tenant_id, instance_id, is_cluster) else: - raise NoSuchOptError('root_controller', group='datastore_manager') + opt = 'root_controller' + raise NoSuchOptError(opt, group='datastore_manager') def delete(self, req, tenant_id, instance_id): datastore_manager, is_cluster = self._get_datastore(tenant_id,