上記のコードを使用してルーターに接続しようとしていますが、juniperj2320.py モジュールを使用しています。テスト ファイルでは、このhttp://subversion.assembla.com/svn/clauzsistel08/trunk/dist/のコード ベースを使用しています。
#!/usr/bin/python
from localconf import *
from juniperj2320 import *
import sys
import traceback
SERIALDEVICE = '/dev/ttyUSB0'
# Now configure the router
try:
router = JuniperJ2320(SERIALDEVICE)
except RouterConfigurationException, err:
print "Router configuration error: ", err
print "Please try again."
sys.exit(1)
しかし、この次のエラーが発生しています
./test.py > /root/pyserial-2.6/examples/serialrouter.py(37)__init__() -> serial.Serial.__init__(self, serialdevice, ボーレート=ボーレート, \ (Pdb) c トレースバック (最新の呼び出しが最後): ファイル「./test.py」の 30 行目 ルーター = JuniperJ2320(SERIALDEVICE) ファイル「/root/pyserial-2.6/examples/juniperj2320.py」、32 行目、__init__ 内 バイトサイズ、パリティ、ストップビット、タイムアウト) ファイル「/root/pyserial-2.6/examples/serialrouter.py」、44 行目、__init__ 内 fdpexpect.fdspawn.__init__(self, self.fileno()) ファイル "/usr/lib/python2.6/site-packages/fdpexpect.py"、40 行目、__init__ 内 spawn.__init__(self, None, args, timeout, maxread, searchwindowsize, logfile ) ファイル "/usr/lib/python2.6/site-packages/pexpect.py"、412 行目、__init__ 内 self.closed = True # ファイルのようなオブジェクト。 AttributeError: 属性を設定できません
そして、ここで起こっていることについては絶対に手がかりがありません!どんな助けでも大歓迎です
ありがとう