@@ -267,7 +267,7 @@ def __init__(self, path, config=None):
267267 try :
268268 reconnect_timeout = float (reconnect_timeout )
269269 except (TypeError , ValueError ):
270- logger .warning ("Unable to convert value '%s ' for reconnect timeout to float" % reconnect_timeout )
270+ logger .warning (f "Unable to convert value '{ reconnect_timeout } ' for reconnect timeout to float" )
271271 reconnect_timeout = self .default_reconnect_timeout
272272
273273 port = config .get ("port" )
@@ -276,7 +276,7 @@ def __init__(self, path, config=None):
276276 try :
277277 port = int (port )
278278 except (TypeError , ValueError ):
279- logger .warning ("Unable to convert value '%s ' for port to int" % port )
279+ logger .warning (f "Unable to convert value '{ port } ' for port to int" )
280280 port = self .default_port
281281
282282 self .client = hpclient (
@@ -341,56 +341,47 @@ def handle_incident(self, i):
341341 def handle_incident_dionaea_connection_tcp_listen (self , icd ):
342342 self .connection_publish (icd , 'listen' )
343343 con = icd .con
344- logger .info ("listen connection on %s:%i" %
345- (con .remote .host , con .remote .port ))
344+ logger .info (f"listen connection on { con .remote .host } :{ con .remote .port } " )
346345
347346 def handle_incident_dionaea_connection_tls_listen (self , icd ):
348347 self .connection_publish (icd , 'listen' )
349348 con = icd .con
350- logger .info ("listen connection on %s:%i" %
351- (con .remote .host , con .remote .port ))
349+ logger .info (f"listen connection on { con .remote .host } :{ con .remote .port } " )
352350
353351 def handle_incident_dionaea_connection_tcp_connect (self , icd ):
354352 self .connection_publish (icd , 'connect' )
355353 con = icd .con
356- logger .info ("connect connection to %s/%s:%i from %s:%i" %
357- (con .remote .host , con .remote .hostname , con .remote .port , self ._ownip (icd ), con .local .port ))
354+ logger .info (f"connect connection to { con .remote .host } /{ con .remote .hostname } :{ con .remote .port } from { self ._ownip (icd )} :{ con .local .port } " )
358355
359356 def handle_incident_dionaea_connection_tls_connect (self , icd ):
360357 self .connection_publish (icd , 'connect' )
361358 con = icd .con
362- logger .info ("connect connection to %s/%s:%i from %s:%i" %
363- (con .remote .host , con .remote .hostname , con .remote .port , self ._ownip (icd ), con .local .port ))
359+ logger .info (f"connect connection to { con .remote .host } /{ con .remote .hostname } :{ con .remote .port } from { self ._ownip (icd )} :{ con .local .port } " )
364360
365361 def handle_incident_dionaea_connection_udp_connect (self , icd ):
366362 self .connection_publish (icd , 'connect' )
367363 con = icd .con
368- logger .info ("connect connection to %s/%s:%i from %s:%i" %
369- (con .remote .host , con .remote .hostname , con .remote .port , self ._ownip (icd ), con .local .port ))
364+ logger .info (f"connect connection to { con .remote .host } /{ con .remote .hostname } :{ con .remote .port } from { self ._ownip (icd )} :{ con .local .port } " )
370365
371366 def handle_incident_dionaea_connection_tcp_accept (self , icd ):
372367 self .connection_publish (icd , 'accept' )
373368 con = icd .con
374- logger .info ("accepted connection from %s:%i to %s:%i" %
375- (con .remote .host , con .remote .port , self ._ownip (icd ), con .local .port ))
369+ logger .info (f"accepted connection from { con .remote .host } :{ con .remote .port } to { self ._ownip (icd )} :{ con .local .port } " )
376370
377371 def handle_incident_dionaea_connection_tls_accept (self , icd ):
378372 self .connection_publish (icd , 'accept' )
379373 con = icd .con
380- logger .info ("accepted connection from %s:%i to %s:%i" %
381- (con .remote .host , con .remote .port , self ._ownip (icd ), con .local .port ))
374+ logger .info (f"accepted connection from { con .remote .host } :{ con .remote .port } to { self ._ownip (icd )} :{ con .local .port } " )
382375
383376 def handle_incident_dionaea_connection_tcp_reject (self , icd ):
384377 self .connection_publish (icd , 'reject' )
385378 con = icd .con
386- logger .info ("reject connection from %s:%i to %s:%i" %
387- (con .remote .host , con .remote .port , self ._ownip (icd ), con .local .port ))
379+ logger .info (f"reject connection from { con .remote .host } :{ con .remote .port } to { self ._ownip (icd )} :{ con .local .port } " )
388380
389381 def handle_incident_dionaea_connection_tcp_pending (self , icd ):
390382 self .connection_publish (icd , 'pending' )
391383 con = icd .con
392- logger .info ("pending connection from %s:%i to %s:%i" %
393- (con .remote .host , con .remote .port , self ._ownip (icd ), con .local .port ))
384+ logger .info (f"pending connection from { con .remote .host } :{ con .remote .port } to { self ._ownip (icd )} :{ con .local .port } " )
394385
395386 def handle_incident_dionaea_download_complete_unique (self , i ):
396387 self .handle_incident_dionaea_download_complete_again (i )
0 commit comments