diff options
author | Ilya Etingof <etingof@gmail.com> | 2016-04-01 01:08:28 +0200 |
---|---|---|
committer | Ilya Etingof <etingof@gmail.com> | 2016-04-01 01:08:28 +0200 |
commit | 9541f201e33cd613995cee2e7a7656aa687deb51 (patch) | |
tree | fdc955b26681f10d7755a2f2aff115c3bcf85bfa /examples/smi | |
parent | 18f39e2228d370a336500c5ecc539658d890f06d (diff) | |
download | pysnmp-git-9541f201e33cd613995cee2e7a7656aa687deb51.tar.gz |
pep8 reformatted
Diffstat (limited to 'examples/smi')
-rw-r--r-- | examples/smi/manager/var-binds-mib-resolution.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/examples/smi/manager/var-binds-mib-resolution.py b/examples/smi/manager/var-binds-mib-resolution.py index ffbd2f92..cee8b7c0 100644 --- a/examples/smi/manager/var-binds-mib-resolution.py +++ b/examples/smi/manager/var-binds-mib-resolution.py @@ -41,7 +41,7 @@ mibVar = rfc1902.ObjectIdentity(str(mibVar)).resolveWithMib(mibView) print(mibVar.prettyPrint(), tuple(mibVar), str(mibVar)) # Obtain MIB object information by a mix of OID/label parts -mibVar = rfc1902.ObjectIdentity((1,3,6,1,2,'mib-2',1,'sysDescr')).resolveWithMib(mibView) +mibVar = rfc1902.ObjectIdentity((1, 3, 6, 1, 2, 'mib-2', 1, 'sysDescr')).resolveWithMib(mibView) print(mibVar.prettyPrint(), tuple(mibVar), str(mibVar)) @@ -85,18 +85,17 @@ varBind = rfc1902.ObjectType( print(varBind[0].prettyPrint(), varBind[1].__class__.__name__, varBind[1].prettyPrint()) # Create var-binds from MIB notification object (without OBJECTS clause) -varBinds = rfc1902.NotificationType( +varBinds = rfc1902.NotificationType( rfc1902.ObjectIdentity('SNMPv2-MIB', 'coldStart') ).resolveWithMib(mibView) -print([ '%s = %s(%s)' % (x[0].prettyPrint(), x[1].__class__.__name__, x[1].prettyPrint()) for x in varBinds]) +print(['%s = %s(%s)' % (x[0].prettyPrint(), x[1].__class__.__name__, x[1].prettyPrint()) for x in varBinds]) # Create var-binds from MIB notification object (with OBJECTS clause) -varBinds = rfc1902.NotificationType( +varBinds = rfc1902.NotificationType( rfc1902.ObjectIdentity('IF-MIB', 'linkUp'), - instanceIndex = (1,), - objects= { ('IF-MIB', 'ifOperStatus'): 'down' } + instanceIndex=(1,), + objects={('IF-MIB', 'ifOperStatus'): 'down'} ).resolveWithMib(mibView) print(varBinds.prettyPrint()) - |