summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/smi/agent/operations-on-managed-objects.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/smi/agent/operations-on-managed-objects.py b/examples/smi/agent/operations-on-managed-objects.py
index b2373829..7d1f300c 100644
--- a/examples/smi/agent/operations-on-managed-objects.py
+++ b/examples/smi/agent/operations-on-managed-objects.py
@@ -33,16 +33,16 @@ varBinds = mibInstrum.writeVars(
(snmpCommunityEntry.name + (7,) + instanceId, 'volatile'))
)
for oid, val in varBinds:
- print('%s = %s' % ('.'.join([str(x) for x in oid]), val.prettyPrint()))
+ print('%s = %s' % ('.'.join([str(x) for x in oid]), not val.isValue and 'N/A' or val.prettyPrint()))
print('done')
print('Read whole MIB (table walk)')
oid, val = (), None
-while 1:
+while True:
oid, val = mibInstrum.readNextVars(((oid, val),))[0]
if exval.endOfMib.isSameTypeWith(val):
break
- print('%s = %s' % ('.'.join([str(x) for x in oid]), val.prettyPrint()))
+ print('%s = %s' % ('.'.join([str(x) for x in oid]), not val.isValue and 'N/A' or val.prettyPrint()))
print('done')
print('Unloading MIB modules...'),