summaryrefslogtreecommitdiff
path: root/examples/v3arch/asyncore/agent/cmdrsp/custom-mib-controller.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/v3arch/asyncore/agent/cmdrsp/custom-mib-controller.py')
-rw-r--r--examples/v3arch/asyncore/agent/cmdrsp/custom-mib-controller.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/examples/v3arch/asyncore/agent/cmdrsp/custom-mib-controller.py b/examples/v3arch/asyncore/agent/cmdrsp/custom-mib-controller.py
index 94bdb7de..7e74df3d 100644
--- a/examples/v3arch/asyncore/agent/cmdrsp/custom-mib-controller.py
+++ b/examples/v3arch/asyncore/agent/cmdrsp/custom-mib-controller.py
@@ -54,7 +54,9 @@ snmpContext = context.SnmpContext(snmpEngine)
# always echos request var-binds in response.
class EchoMibInstrumController(instrum.AbstractMibInstrumController):
def readVars(self, *varBinds, **context):
- return [(ov[0], v2c.OctetString('You queried OID %s' % ov[0])) for ov in varBinds]
+ cbFun = context.get('cbFun')
+ if cbFun:
+ cbFun([(ov[0], v2c.OctetString('You queried OID %s' % ov[0])) for ov in varBinds], **context)
# Create a custom Management Instrumentation Controller and register at