From 1452099bef662e2914466da131398bb8ae3b35d5 Mon Sep 17 00:00:00 2001 From: Maly Date: Tue, 11 May 2021 23:50:50 +0900 Subject: [PATCH] [MODIFY] Rename --- application/decorator/metadata.py | 9 +++++---- application/servicers/outing_parents_servicer.py | 8 ++++---- application/servicers/outing_student_servicer.py | 14 +++++++------- application/servicers/outing_teacher_servicer.py | 12 ++++++------ 4 files changed, 22 insertions(+), 21 deletions(-) diff --git a/application/decorator/metadata.py b/application/decorator/metadata.py index fec6b8a..2df26d2 100644 --- a/application/decorator/metadata.py +++ b/application/decorator/metadata.py @@ -6,8 +6,7 @@ from domain.exception.not_proxy_auth.bad_x_request_id_exception import BadXRequestId - -def jagger_enable(fn): +def jaeger_enable(fn): @wraps(fn) def wrapper(*args, **kwargs): flag = 0 @@ -23,8 +22,10 @@ def wrapper(*args, **kwargs): parents_span = v flag += 1 else: - if not x_request_id: raise BadXRequestId - elif not parents_span: raise BadSpanContext + if not x_request_id: + raise BadXRequestId + elif not parents_span: + raise BadSpanContext open_tracing_service = OpenTracing(open_tracing.tracer, parents_span, x_request_id) return open_tracing_service.start_active_span(fn, *args, **kwargs) diff --git a/application/servicers/outing_parents_servicer.py b/application/servicers/outing_parents_servicer.py index 500f0d9..1dc8106 100644 --- a/application/servicers/outing_parents_servicer.py +++ b/application/servicers/outing_parents_servicer.py @@ -10,7 +10,7 @@ from infrastructure.implementation.repository.outing_repository_impl import OutingRepositoryImpl from proto.python.outing import outing_parents_pb2_grpc, outing_parents_pb2 -from application.decorator.metadata import jagger_enable +from application.decorator.metadata import jaeger_enable from application.decorator.error_handling import error_handling @@ -46,16 +46,16 @@ def __init__(self): ) @error_handling(outing_parents_pb2.ConfirmOutingByOCodeResponse) - @jagger_enable + @jaeger_enable def ApproveOutingByOCode(self, request, context): return self.service.approve_outing(request, context) @error_handling(outing_parents_pb2.ConfirmOutingByOCodeResponse) - @jagger_enable + @jaeger_enable def RejectOutingByOCode(self, request, context): return self.service.reject_outing(request, context) @error_handling(outing_parents_pb2.GetOutingByOCodeResponse) - @jagger_enable + @jaeger_enable def GetOutingByOCode(self, request, context): return self.service.get_outing(request, context) \ No newline at end of file diff --git a/application/servicers/outing_student_servicer.py b/application/servicers/outing_student_servicer.py index 1879ada..2f581e7 100644 --- a/application/servicers/outing_student_servicer.py +++ b/application/servicers/outing_student_servicer.py @@ -1,4 +1,4 @@ -from application.decorator.metadata import jagger_enable +from application.decorator.metadata import jaeger_enable from application.decorator.error_handling import error_handling from infrastructure.implementation.repository.confirm_code_repository_impl import ConfirmCodeRepositoryImpl from infrastructure.implementation.repository.parents_repository_impl import ParentsRepositoryImpl @@ -75,31 +75,31 @@ def __init__(self): ) @error_handling(outing_student_pb2.CreateOutingResponse) - @jagger_enable + @jaeger_enable def CreateOuting(self, request, context): return self.service.create_outing(request, context) @error_handling(outing_student_pb2.GetCardAboutOutingResponse) - @jagger_enable + @jaeger_enable def GetCardAboutOuting(self, request, context): return self.service.get_card_about_outing(request, context) @error_handling(outing_student_pb2.GetOutingInformResponse) - @jagger_enable + @jaeger_enable def GetOutingInform(self, request, context): return self.service.get_outing_inform(request, context) @error_handling(outing_student_pb2.GetStudentOutingsResponse) - @jagger_enable + @jaeger_enable def GetStudentOutings(self, request, context): return self.service.get_student_outings(request, context) @error_handling(outing_student_pb2.GoOutResponse) - @jagger_enable + @jaeger_enable def StartGoOut(self, request, context): return self.service.go_out(request, context) @error_handling(outing_student_pb2.GoOutResponse) - @jagger_enable + @jaeger_enable def FinishGoOut(self, request, context): return self.service.finish_go_out(request, context) diff --git a/application/servicers/outing_teacher_servicer.py b/application/servicers/outing_teacher_servicer.py index 3bab964..73d5267 100644 --- a/application/servicers/outing_teacher_servicer.py +++ b/application/servicers/outing_teacher_servicer.py @@ -11,7 +11,7 @@ from service.mapper.teacher_outing_mapper import TeacherOutingMapper from service.teacher_outing_service import TeacherOutingService -from application.decorator.metadata import jagger_enable +from application.decorator.metadata import jaeger_enable from application.decorator.error_handling import error_handling from infrastructure.implementation.repository.outing_repository_impl import OutingRepositoryImpl @@ -56,26 +56,26 @@ def __init__(self): ) @error_handling(outing_teacher_pb2.OutingResponse) - @jagger_enable + @jaeger_enable def GetOutingWithFilter(self, request, context): return self.service.get_outings_with_filter(request, context) @error_handling(outing_teacher_pb2.ConfirmOutingResponse) - @jagger_enable + @jaeger_enable def ApproveOuting(self, request, context): return self.service.approve_outing(request, context) @error_handling(outing_teacher_pb2.ConfirmOutingResponse) - @jagger_enable + @jaeger_enable def RejectOuting(self, request, context): return self.service.reject_outing(request, context) @error_handling(outing_teacher_pb2.ConfirmOutingResponse) - @jagger_enable + @jaeger_enable def CertifyOuting(self, request, context): return self.service.certify_outing(request, context) @error_handling(outing_teacher_pb2.ConfirmOutingResponse) - @jagger_enable + @jaeger_enable def ModifyOuting(self, request, context): return self.service.modify_outing(request, context) \ No newline at end of file