diff --git a/muranoapi/api/middleware/version_negotiation.py b/muranoapi/api/middleware/version_negotiation.py index 8215b812..2c91f4ef 100644 --- a/muranoapi/api/middleware/version_negotiation.py +++ b/muranoapi/api/middleware/version_negotiation.py @@ -47,19 +47,19 @@ class VersionNegotiationFilter(wsgi.Middleware): args = {'method': req.method, 'path': req.path, 'accept': req.accept} LOG.debug(msg % args) - LOG.debug(_("Using url versioning")) + LOG.debug("Using url versioning") # Remove version in url so it doesn't conflict later req_version = self._pop_path_info(req) try: version = self._match_version_string(req_version) except ValueError: - LOG.debug(_("Unknown version. Returning version choices.")) + LOG.debug("Unknown version. Returning version choices.") return self.versions_app req.environ['api.version'] = version req.path_info = ''.join(('/v', str(version), req.path_info)) - LOG.debug(_("Matched version: v%d"), version) + LOG.debug("Matched version: v%d", version) LOG.debug('new path %s' % req.path_info) return None diff --git a/muranoapi/api/v1/environments.py b/muranoapi/api/v1/environments.py index f1b5ffab..f0eac7ae 100644 --- a/muranoapi/api/v1/environments.py +++ b/muranoapi/api/v1/environments.py @@ -35,7 +35,7 @@ class Controller(object): @request_statistics.stats_count(API_NAME, 'Index') def index(self, request): - LOG.debug(_('Environments:List')) + LOG.debug('Environments:List') #Only environments from same tenant as user should be returned filters = {'tenant_id': request.context.tenant} @@ -46,7 +46,7 @@ class Controller(object): @request_statistics.stats_count(API_NAME, 'Create') def create(self, request, body): - LOG.debug(_('Environments:Create ').format(body)) + LOG.debug('Environments:Create '.format(body)) environment = envs.EnvironmentServices.create(body.copy(), request.context.tenant) @@ -55,7 +55,7 @@ class Controller(object): @request_statistics.stats_count(API_NAME, 'Show') def show(self, request, environment_id): - LOG.debug(_('Environments:Show ').format(environment_id)) + LOG.debug('Environments:Show '.format(environment_id)) session = db_session.get_session() environment = session.query(models.Environment).get(environment_id) @@ -85,8 +85,8 @@ class Controller(object): @request_statistics.stats_count(API_NAME, 'Update') def update(self, request, environment_id, body): - LOG.debug(_('Environments:Update ').format(environment_id, body)) + LOG.debug('Environments:Update '.format(environment_id, body)) session = db_session.get_session() environment = session.query(models.Environment).get(environment_id) @@ -108,7 +108,7 @@ class Controller(object): @request_statistics.stats_count(API_NAME, 'Delete') def delete(self, request, environment_id): - LOG.debug(_('Environments:Delete ').format(environment_id)) + LOG.debug('Environments:Delete '.format(environment_id)) unit = db_session.get_session() environment = unit.query(models.Environment).get(environment_id) diff --git a/muranoapi/api/v1/instance_statistics.py b/muranoapi/api/v1/instance_statistics.py index 846c0555..6712f31f 100644 --- a/muranoapi/api/v1/instance_statistics.py +++ b/muranoapi/api/v1/instance_statistics.py @@ -27,7 +27,7 @@ API_NAME = 'EnvironmentStatistics' class Controller(object): @request_statistics.stats_count(API_NAME, 'GetAggregated') def get_aggregated(self, request, environment_id): - LOG.debug(_('EnvironmentStatistics:GetAggregated')) + LOG.debug('EnvironmentStatistics:GetAggregated') # TODO (stanlagun): Check that caller is authorized to access # tenant's statistics @@ -37,7 +37,7 @@ class Controller(object): @request_statistics.stats_count(API_NAME, 'GetForInstance') def get_for_instance(self, request, environment_id, instance_id): - LOG.debug(_('EnvironmentStatistics:GetForInstance')) + LOG.debug('EnvironmentStatistics:GetForInstance') # TODO (stanlagun): Check that caller is authorized to access # tenant's statistics @@ -47,7 +47,7 @@ class Controller(object): @request_statistics.stats_count(API_NAME, 'GetForEnvironment') def get_for_environment(self, request, environment_id): - LOG.debug(_('EnvironmentStatistics:GetForEnvironment')) + LOG.debug('EnvironmentStatistics:GetForEnvironment') # TODO (stanlagun): Check that caller is authorized to access # tenant's statistics diff --git a/muranoapi/api/v1/services.py b/muranoapi/api/v1/services.py index 70a15865..6fe234c1 100644 --- a/muranoapi/api/v1/services.py +++ b/muranoapi/api/v1/services.py @@ -48,8 +48,8 @@ class Controller(object): @utils.verify_env @normalize_path def get(self, request, environment_id, path): - LOG.debug(_('Services:Get ').format(environment_id, path)) + LOG.debug('Services:Get '.format(environment_id, path)) session_id = None if hasattr(request, 'context') and request.context.session: @@ -69,8 +69,8 @@ class Controller(object): @normalize_path def post(self, request, environment_id, path, body): secure_data = token_sanitizer.TokenSanitizer().sanitize(body) - LOG.debug(_('Services:Post ').format(environment_id, secure_data, path)) + LOG.debug('Services:Post '.format(environment_id, secure_data, path)) post_data = core_services.CoreServices.post_data session_id = request.context.session @@ -85,8 +85,8 @@ class Controller(object): @utils.verify_env @normalize_path def put(self, request, environment_id, path, body): - LOG.debug(_('Services:Put ').format(environment_id, body, path)) + LOG.debug('Services:Put '.format(environment_id, body, path)) put_data = core_services.CoreServices.put_data session_id = request.context.session @@ -102,8 +102,8 @@ class Controller(object): @utils.verify_env @normalize_path def delete(self, request, environment_id, path): - LOG.debug(_('Services:Put ').format(environment_id, path)) + LOG.debug('Services:Put '.format(environment_id, path)) delete_data = core_services.CoreServices.delete_data session_id = request.context.session diff --git a/muranoapi/api/v1/sessions.py b/muranoapi/api/v1/sessions.py index 77ede814..663cbf69 100644 --- a/muranoapi/api/v1/sessions.py +++ b/muranoapi/api/v1/sessions.py @@ -32,7 +32,7 @@ API_NAME = 'Sessions' class Controller(object): @request_statistics.stats_count(API_NAME, 'Create') def configure(self, request, environment_id): - LOG.debug(_('Session:Configure ').format(environment_id)) + LOG.debug('Session:Configure '.format(environment_id)) unit = db_session.get_session() environment = unit.query(models.Environment).get(environment_id) @@ -62,7 +62,7 @@ class Controller(object): @request_statistics.stats_count(API_NAME, 'Index') def show(self, request, environment_id, session_id): - LOG.debug(_('Session:Show ').format(session_id)) + LOG.debug('Session:Show '.format(session_id)) unit = db_session.get_session() session = unit.query(models.Session).get(session_id) @@ -92,7 +92,7 @@ class Controller(object): @request_statistics.stats_count(API_NAME, 'Delete') def delete(self, request, environment_id, session_id): - LOG.debug(_('Session:Delete ').format(session_id)) + LOG.debug('Session:Delete '.format(session_id)) unit = db_session.get_session() session = unit.query(models.Session).get(session_id) @@ -125,7 +125,7 @@ class Controller(object): @request_statistics.stats_count(API_NAME, 'Deploy') def deploy(self, request, environment_id, session_id): - LOG.debug(_('Session:Deploy ').format(session_id)) + LOG.debug('Session:Deploy '.format(session_id)) unit = db_session.get_session() session = unit.query(models.Session).get(session_id) diff --git a/muranoapi/common/server.py b/muranoapi/common/server.py index c07a9501..581b4ff2 100644 --- a/muranoapi/common/server.py +++ b/muranoapi/common/server.py @@ -40,14 +40,14 @@ class ResultEndpoint(object): @staticmethod def process_result(context, result): secure_result = token_sanitizer.TokenSanitizer().sanitize(result) - LOG.debug(_('Got result from orchestration ' - 'engine:\n{0}').format(secure_result)) + LOG.debug('Got result from orchestration ' + 'engine:\n{0}'.format(secure_result)) result_id = result['Objects']['?']['id'] if 'deleted' in result: - LOG.debug(_('Result for environment {0} is dropped. Environment ' - 'is deleted').format(result_id)) + LOG.debug('Result for environment {0} is dropped. Environment ' + 'is deleted'.format(result_id)) return unit = session.get_session() @@ -115,8 +115,8 @@ def notification_endpoint_wrapper(priority='info'): @notification_endpoint_wrapper() def track_instance(payload): - LOG.debug(_('Got track instance request from orchestration ' - 'engine:\n{0}').format(payload)) + LOG.debug('Got track instance request from orchestration ' + 'engine:\n{0}'.format(payload)) instance_id = payload['instance'] instance_type = payload.get('instance_type', 0) environment_id = payload['environment'] @@ -131,8 +131,8 @@ def track_instance(payload): @notification_endpoint_wrapper() def untrack_instance(payload): - LOG.debug(_('Got untrack instance request from orchestration ' - 'engine:\n{0}').format(payload)) + LOG.debug('Got untrack instance request from orchestration ' + 'engine:\n{0}'.format(payload)) instance_id = payload['instance'] environment_id = payload['environment'] instances.InstanceStatsServices.destroy_instance( @@ -141,8 +141,8 @@ def untrack_instance(payload): @notification_endpoint_wrapper() def report_notification(report): - LOG.debug(_('Got report from orchestration ' - 'engine:\n{0}').format(report)) + LOG.debug('Got report from orchestration ' + 'engine:\n{0}'.format(report)) report['entity_id'] = report['id'] del report['id'] diff --git a/muranoapi/common/statservice.py b/muranoapi/common/statservice.py index 6c29f7ca..67b0c70f 100644 --- a/muranoapi/common/statservice.py +++ b/muranoapi/common/statservice.py @@ -54,7 +54,7 @@ class StatsCollectingService(service.Service): eventlet.sleep(period) def update_stats(self): - LOG.debug(_("Updating statistic information.")) + LOG.debug("Updating statistic information.") LOG.debug("Stats object: %s" % v1.stats) LOG.debug("Stats: Requests:%s Errors: %s Ave.Res.Time %2.4f\n" "Per tenant: %s" %