summaryrefslogtreecommitdiff
path: root/examples/v3arch/twisted/manager/cmdgen/get-v2c-custom-timeout.py
diff options
context:
space:
mode:
authorelie <elie>2014-06-17 05:46:57 +0000
committerelie <elie>2014-06-17 05:46:57 +0000
commitdad702f69446abcbcf32584743beb47f4583e0cd (patch)
treedce4559a9651d3cb6e361b1382e15e84fd306836 /examples/v3arch/twisted/manager/cmdgen/get-v2c-custom-timeout.py
parent6acd5123d163c9af8d529309842d0e7b6fecc4c4 (diff)
downloadpysnmp-dad702f69446abcbcf32584743beb47f4583e0cd.tar.gz
converted to the latest API that supports more data to be used
Diffstat (limited to 'examples/v3arch/twisted/manager/cmdgen/get-v2c-custom-timeout.py')
-rw-r--r--examples/v3arch/twisted/manager/cmdgen/get-v2c-custom-timeout.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/examples/v3arch/twisted/manager/cmdgen/get-v2c-custom-timeout.py b/examples/v3arch/twisted/manager/cmdgen/get-v2c-custom-timeout.py
index 5e36d99..246a1b9 100644
--- a/examples/v3arch/twisted/manager/cmdgen/get-v2c-custom-timeout.py
+++ b/examples/v3arch/twisted/manager/cmdgen/get-v2c-custom-timeout.py
@@ -51,8 +51,8 @@ config.addTargetAddr(
)
# Error/response receiver
-def cbFun(cbCtx):
- (errorIndication, errorStatus, errorIndex, varBinds) = cbCtx
+def cbFun(response, *args):
+ snmpEngine, errorIndication, errorStatus, errorIndex, varBinds = response
if errorIndication:
print(errorIndication)
elif errorStatus:
@@ -68,10 +68,11 @@ def cbFun(cbCtx):
reactor.stop()
# Prepare request to be sent yielding Twisted deferred object
-df = cmdgen.GetCommandGenerator().sendReq(
+df = cmdgen.GetCommandGenerator().sendVarBinds(
snmpEngine,
'my-router',
- ( ('1.3.6.1.2.1.1.1.0', None), ),
+ None, '', # contextEngineId, contextName
+ [ ('1.3.6.1.2.1.1.1.0', None) ],
)
# Register error/response receiver function at deferred