cleaner logging

This commit is contained in:
Tom Duijf 2015-10-08 14:54:20 +00:00
parent 721c1d0f54
commit ee23c0fe14

View file

@ -128,18 +128,12 @@ class SnmpScanner(object):
) )
if errindication: if errindication:
# Supressing logging-format-interpolation _LOGGER.error("SNMPLIB error: %s", errindication)
# pylint: disable=W1202
_LOGGER.error("SNMPLIB error: {}".format(errindication))
return return
if errstatus: if errstatus:
err = "SNMP error: {} at {}" _LOGGER.error('SNMP error: %s at %s', errstatus.prettyPrint(),
# Supressing logging-format-interpolation errindex and restable[-1][int(errindex)-1]
# pylint: disable=W1202 or '?')
_LOGGER.error(err.format(errstatus.prettyPrint(),
errindex and
restable[-1][int(errindex)-1]
or '?'))
return return
for resrow in restable: for resrow in restable: