hi, every body.

when I using net-snmp python binding, I found a bug:

my test code:

  1 import netsnmp
  2 import sys
  3 import os
  4
  5 o = netsnmp.Varbind("sysDescr")
  6 netsnmp.snmpwalk( NotInList = o, Version = 2, DestHost="localhost",
Community="public")

when I run the code, python complain:

Traceback (most recent call last):
  File "/tmp/test_netsnmp.py", line 6, in <module>
    netsnmp.snmpwalk( NotInList = o, Version = 2, DestHost="localhost",
Community="public")
  File
"/usr/local/python2.6/lib/python2.6/site-packages/netsnmp_python-1.0a1-py2.6-linux-x86_64.egg/netsnmp/client.py",
line 228, in snmpwalk
    sess = Session(**kargs)
  File
"/usr/local/python2.6/lib/python2.6/site-packages/netsnmp_python-1.0a1-py2.6-linux-x86_64.egg/netsnmp/client.py",
line 123, in __init__
    sess_args = _parse_session_args(args)
  File
"/usr/local/python2.6/lib/python2.6/site-packages/netsnmp_python-1.0a1-py2.6-linux-x86_64.egg/netsnmp/client.py",
line 38, in _parse_session_args
    print stderr, "ERROR: unknown key", key
NameError: global name 'stderr' is not defined




file : ./python/netsnmp/client.py

code:
 34     for key in keys:
 35         if sessArgs.has_key(key):
 36             sessArgs[key] = kargs[key]
 37         else:
 38             print stderr, "ERROR: unknown key", key
 39     return sessArgs


"stderr" Not defined before use

after remove "stderr" if OK.





-- 
-- 
梁庆喜 jessi...@gmail.com
Mobile: 18675608050
Email: jessi...@gmail.com
MSN: jessi...@163.com
Blog: http://blog.jessinio.info
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to