我已经实现了一个 python 程序来将数据发送到瞻博网络 wlc100 控制器。我必须使用预先编写的瞻博网络 wlc 文件将数据发送到控制器。错误是缺少“主机”参数。我认为我们不需要将主机参数与我通过查看程序已经传递的 3 个参数一起发送。查看 jnpr.wlc 代码的 github 页面是https://github.com/Juniper/py-jnpr-wlc。请花点时间帮助我。谢谢。
我得到的错误是:
from jnpr.wlc import WirelessLanController as WLC
import sys
import urllib2
def WLC_login():
login = {
'user': 'xxxxx',
'hostname': '172.31.99.14',
'password': 'xxxxx',
}
wlc = WLC( login )
try_again = 3
login_ok = False
while try_again > 1:
try:
wlc.open()
login_ok = True
print("Login successful")
break;
except:
try_again-=1
print "Unexpected error:", sys.exc_info()[0]
if not login_ok:
sys.exit(1)
return wlc
WLC_login()
跟踪转储是:
Traceback (most recent call last):
File "C:/Python27/py-jnpr-wlc-master/new.py", line 27, in <module>
WLC_login()
File "C:/Python27/py-jnpr-wlc-master/new.py", line 11, in WLC_login
wlc = WLC( login )
File "C:\Python27\lib\site-packages\jnpr_wlc-0.0.1-py2.7.egg\jnpr\wlc\wlc.py", line 160, in __init__
assert (_a in kvargs), ("Missing required param: %s" % _a)
AssertionError: Missing required param: host