From f6f2ea9ca73f240c30046ef1ef0078580493c1ff Mon Sep 17 00:00:00 2001
From: Robert Latta <robert.latta@geant.org>
Date: Wed, 19 Feb 2020 11:56:23 +0000
Subject: [PATCH] added hostname to error message

---
 inventory_provider/snmp.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/inventory_provider/snmp.py b/inventory_provider/snmp.py
index 6ca9e170..ded726e7 100644
--- a/inventory_provider/snmp.py
+++ b/inventory_provider/snmp.py
@@ -62,8 +62,8 @@ def walk(agent_hostname, community, base_oid):  # pragma: no cover
         # cf. http://snmplabs.com/
         #       pysnmp/examples/hlapi/asyncore/sync/contents.html
         assert not engineErrorIndication, (
-            'snmp response engine error indication: %r'
-            % str(engineErrorIndication))
+            f'snmp response engine error indication: '
+            f'{str(engineErrorIndication)} - {agent_hostname}')
         assert not pduErrorIndication, 'snmp response pdu error %r at %r' % (
             pduErrorIndication,
             errorIndex and varBinds[int(errorIndex) - 1][0] or '?')
-- 
GitLab