Change leftover %-logging calls to lazy

Change-Id: I0bee8d02ac364ab93f77919cae78afa386b85c85
Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/30899
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Alexander Zaft <a.zaft@fz-juelich.de>
This commit is contained in:
Alexander Zaft
2023-04-13 14:10:36 +02:00
parent 1dcd1db4eb
commit c114dbab26
15 changed files with 47 additions and 47 deletions

View File

@@ -140,8 +140,8 @@ class Dispatcher:
self.reset_connection(conn)
def register_module(self, moduleobj, modulename, export=True):
self.log.debug('registering module %r as %s (export=%r)' %
(moduleobj, modulename, export))
self.log.debug('registering module %r as %s (export=%r)',
moduleobj, modulename, export)
self._modules[modulename] = moduleobj
if export:
self._export.append(modulename)
@@ -168,15 +168,15 @@ class Dispatcher:
return self._export[:]
def export_accessibles(self, modulename):
self.log.debug('export_accessibles(%r)' % modulename)
self.log.debug('export_accessibles(%r)', modulename)
if modulename in self._export:
# omit export=False params!
res = OrderedDict()
for aobj in self.get_module(modulename).accessibles.values():
if aobj.export:
res[aobj.export] = aobj.for_export()
self.log.debug('list accessibles for module %s -> %r' %
(modulename, res))
self.log.debug('list accessibles for module %s -> %r',
modulename, res)
return res
self.log.debug('-> module is not to be exported!')
return OrderedDict()
@@ -282,7 +282,7 @@ class Dispatcher:
will return return reply, may send replies to conn or
activated connections in addition
"""
self.log.debug('Dispatcher: handling msg: %s' % repr(msg))
self.log.debug('Dispatcher: handling msg: %s', repr(msg))
# play thread safe !
# XXX: ONLY ONE REQUEST (per dispatcher) AT A TIME
@@ -292,7 +292,7 @@ class Dispatcher:
if action == IDENTREQUEST:
action, specifier, data = '_ident', None, None
self.log.debug('Looking for handle_%s' % action)
self.log.debug('Looking for handle_%s', action)
handler = getattr(self, 'handle_%s' % action, None)
if handler:

View File

@@ -131,7 +131,7 @@ class TCPRequestHandler(socketserver.BaseRequestHandler):
print('====================')
if not result:
self.log.error('empty result upon msg %s' % repr(msg))
self.log.error('empty result upon msg %s', repr(msg))
if result[0].startswith(ERRORPREFIX) and not detailed_errors:
# strip extra information
result[2][2].clear()
@@ -193,7 +193,7 @@ class TCPServer(socketserver.ThreadingTCPServer):
port = int(options.pop('uri').split('://', 1)[-1])
self.detailed_errors = options.pop('detailed_errors', False)
self.log.info("TCPServer %s binding to port %d" % (name, port))
self.log.info("TCPServer %s binding to port %d", name, port)
for ntry in range(5):
try:
socketserver.ThreadingTCPServer.__init__(
@@ -204,10 +204,10 @@ class TCPServer(socketserver.ThreadingTCPServer):
# this may happen despite of allow_reuse_address
time.sleep(0.3 * (1 << ntry)) # max accumulated sleep time: 0.3 * 31 = 9.3 sec
else:
self.log.error('could not initialize TCP Server: %r' % e)
self.log.error('could not initialize TCP Server: %r', e)
raise
if ntry:
self.log.warning('tried again %d times after "Address already in use"' % ntry)
self.log.warning('tried again %d times after "Address already in use"', ntry)
self.log.info("TCPServer initiated")
# py35 compatibility