diff options
author | Ilya Etingof <etingof@gmail.com> | 2016-04-01 22:58:56 +0200 |
---|---|---|
committer | Ilya Etingof <etingof@gmail.com> | 2016-04-01 22:58:56 +0200 |
commit | 020791a97232849c9504024834906dd4a4ffb36c (patch) | |
tree | 6e5d69aa01877ee004efb77645b8148e586610cc /examples/v3arch/asyncore/manager/cmdgen/usm-sha-none.py | |
parent | 9541f201e33cd613995cee2e7a7656aa687deb51 (diff) | |
download | pysnmp-git-020791a97232849c9504024834906dd4a4ffb36c.tar.gz |
pep8 reformatted
Diffstat (limited to 'examples/v3arch/asyncore/manager/cmdgen/usm-sha-none.py')
-rw-r--r-- | examples/v3arch/asyncore/manager/cmdgen/usm-sha-none.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/examples/v3arch/asyncore/manager/cmdgen/usm-sha-none.py b/examples/v3arch/asyncore/manager/cmdgen/usm-sha-none.py index 45692e4c..807822bf 100644 --- a/examples/v3arch/asyncore/manager/cmdgen/usm-sha-none.py +++ b/examples/v3arch/asyncore/manager/cmdgen/usm-sha-none.py @@ -50,6 +50,7 @@ config.addTargetAddr( 'my-creds' ) + # Error/response receiver # noinspection PyUnusedLocal,PyUnusedLocal,PyUnusedLocal def cbFun(snmpEngine, sendRequestHandle, errorIndication, @@ -57,21 +58,19 @@ def cbFun(snmpEngine, sendRequestHandle, errorIndication, if errorIndication: print(errorIndication) elif errorStatus: - print('%s at %s' % ( - errorStatus.prettyPrint(), - errorIndex and varBinds[int(errorIndex)-1][0] or '?' - ) - ) + print('%s at %s' % (errorStatus.prettyPrint(), + errorIndex and varBinds[int(errorIndex) - 1][0] or '?')) else: for oid, val in varBinds: print('%s = %s' % (oid.prettyPrint(), val.prettyPrint())) + # Prepare and send a request message cmdgen.SetCommandGenerator().sendVarBinds( snmpEngine, 'my-router', None, '', # contextEngineId, contextName - [ ((1,3,6,1,2,1,1,9,1,3,1), rfc1902.OctetString('my new value')) ], + [((1, 3, 6, 1, 2, 1, 1, 9, 1, 3, 1), rfc1902.OctetString('my new value'))], cbFun ) |