summaryrefslogtreecommitdiff
path: root/examples/hlapi/asyncore/sync/manager/cmdgen/usm-md5-none.py
diff options
context:
space:
mode:
authorIlya Etingof <etingof@gmail.com>2016-03-30 23:47:36 +0200
committerIlya Etingof <etingof@gmail.com>2016-03-30 23:47:36 +0200
commit929eb1b5339e13b77d1f75fca1efc79adb316223 (patch)
treeb0e14b55a4b9146464dc590a4bbc703ad65eda9e /examples/hlapi/asyncore/sync/manager/cmdgen/usm-md5-none.py
parent8e655f46e39b78290818345bb07e98dbe7b063b9 (diff)
downloadpysnmp-git-929eb1b5339e13b77d1f75fca1efc79adb316223.tar.gz
pep8 fixes
Diffstat (limited to 'examples/hlapi/asyncore/sync/manager/cmdgen/usm-md5-none.py')
-rw-r--r--examples/hlapi/asyncore/sync/manager/cmdgen/usm-md5-none.py20
1 files changed, 8 insertions, 12 deletions
diff --git a/examples/hlapi/asyncore/sync/manager/cmdgen/usm-md5-none.py b/examples/hlapi/asyncore/sync/manager/cmdgen/usm-md5-none.py
index c38d2f32..f06964e2 100644
--- a/examples/hlapi/asyncore/sync/manager/cmdgen/usm-md5-none.py
+++ b/examples/hlapi/asyncore/sync/manager/cmdgen/usm-md5-none.py
@@ -11,28 +11,24 @@ Send SNMP GET request using the following options:
Functionally similar to:
-| $ snmpget -v3 -l authNoPriv -u usr-md5-none -A authkey1 demo.snmplabs.com \
-| IF-MIB::ifInOctets.1
+| $ snmpget -v3 -l authNoPriv -u usr-md5-none -A authkey1 demo.snmplabs.com IF-MIB::ifInOctets.1
"""#
from pysnmp.hlapi import *
errorIndication, errorStatus, errorIndex, varBinds = next(
getCmd(SnmpEngine(),
- UsmUserData('usr-md5-none', 'authkey1'),
- UdpTransportTarget(('demo.snmplabs.com', 161)),
- ContextData(),
- ObjectType(ObjectIdentity('IF-MIB', 'ifInOctets', 1)))
+ UsmUserData('usr-md5-none', 'authkey1'),
+ UdpTransportTarget(('demo.snmplabs.com', 161)),
+ ContextData(),
+ ObjectType(ObjectIdentity('IF-MIB', 'ifInOctets', 1)))
)
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 varBind in varBinds:
- print(' = '.join([ x.prettyPrint() for x in varBind ]))
+ print(' = '.join([x.prettyPrint() for x in varBind]))