Skip to content

Commit 15fa195

Browse files
committed
Update custom_routing.py log details
1 parent 61def46 commit 15fa195

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/satosa/micro_services/custom_routing.py

+10-5
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,20 @@ def get_backend_by_endpoint_path(self, context, native_backend,
5858
raise SATOSABackendNotFoundError("'{}' not found in "
5959
"proxy_conf.yaml".format(tr_backend))
6060

61+
if not backends.get(tr_backend):
62+
raise SATOSABackendNotFoundError("'{}' not found in "
63+
"proxy_conf.yaml".format(tr_backend))
64+
6165
tr_path = context.path.replace(native_backend, tr_backend)
6266
for endpoint in backends[tr_backend]['endpoints']:
6367
# remove regex trailing chars
6468
if tr_path == endpoint[0].strip('^').strip('$'):
65-
msg = ('Found DecideBackendByTarget ({} microservice ) '
66-
'redirecting {} backend to {}').format(self.name,
67-
native_backend,
68-
tr_backend)
69-
satosa_logging(logger, logging.DEBUG, msg, context.state)
69+
msg = ('Found DecideBackendByTarget ({} microservice) '
70+
'redirecting {} from {} backend to {}').format(self.name,
71+
entity_id,
72+
native_backend,
73+
tr_backend)
74+
satosa_logging(logger, logging.INFO, msg, context.state)
7075
return (tr_backend, tr_path)
7176
return
7277

0 commit comments

Comments
 (0)