summaryrefslogtreecommitdiff
path: root/examples/smi
diff options
context:
space:
mode:
authorIlya Etingof <etingof@gmail.com>2016-03-31 00:04:43 +0200
committerIlya Etingof <etingof@gmail.com>2016-03-31 00:04:43 +0200
commit002bb632e888e90577c87111f99674be153f79d0 (patch)
tree528dffe86368b663806bf095c1d89e7498ae7dfe /examples/smi
parente4c4e376316835e9eff0ac4df15ec29db7a7808b (diff)
downloadpysnmp-git-002bb632e888e90577c87111f99674be153f79d0.tar.gz
pep8 fixes
Diffstat (limited to 'examples/smi')
-rw-r--r--examples/smi/agent/custom-managed-object.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/examples/smi/agent/custom-managed-object.py b/examples/smi/agent/custom-managed-object.py
index 56fd15c8..87dea364 100644
--- a/examples/smi/agent/custom-managed-object.py
+++ b/examples/smi/agent/custom-managed-object.py
@@ -12,27 +12,29 @@ mibBuilder = builder.MibBuilder()
# A base class for a custom Managed Object
MibScalarInstance, = mibBuilder.importSymbols(
'SNMPv2-SMI', 'MibScalarInstance'
- )
+)
# Managed object specification
sysLocation, = mibBuilder.importSymbols('SNMPv2-MIB', 'sysLocation')
+
# Custom Managed Object
class MySysLocationInstance(MibScalarInstance):
# noinspection PyUnusedLocal
def readGet(self, name, *args):
# Just return a custom value
return name, self.syntax.clone('The Leaky Cauldron')
-
+
+
sysLocationInstance = MySysLocationInstance(
sysLocation.name, (0,), sysLocation.syntax
- )
+)
# Register Managed Object with a MIB tree
mibBuilder.exportSymbols(
# '__' prefixed MIB modules take precedence on indexing
'__MY-LOCATION-MIB', sysLocationInstance=sysLocationInstance
- )
+)
if __name__ == '__main__':
#