Juniper / py-junos-netconify

Junos console/bootstrap automation Python module
Apache License 2.0
67 stars 30 forks source link

Issue in loading config in physical device from managment port #45

Closed Jainpriyal closed 7 years ago

Jainpriyal commented 8 years ago

When I am trying to load config in physical router from management port, then its loading config properly but giving error while logging out from device.

(venv)sh-3.2# netconify --telnet=host,23 -f file.config -u demo -P demo123
TTY:login:connecting to TTY:choc-ex4300-c:23 ...
TTY:login:logging in ...
TTY:login:starting NETCONF
conf:loading into device ...
conf:commit ... please be patient
conf:commit completed.
TTY:logout:logging out ...
ERROR:[Errno 54] Connection reset by peer

Traceback (most recent call last):
  File "/Users/jpriyal/Desktop/developement/netconify_pyEz/venv/bin/netconify", line 6, in <module>
    results = nc.run()
  File "/Users/jpriyal/Desktop/developement/netconify_pyEz/venv/lib/python2.7/site-packages/netconify/cmdo.py", line 250, in run
    self._hook_exception('logout', err)
  File "/Users/jpriyal/Desktop/developement/netconify_pyEz/venv/lib/python2.7/site-packages/netconify/cmdo.py", line 248, in run
    self._tty_logout()
  File "/Users/jpriyal/Desktop/developement/netconify_pyEz/venv/lib/python2.7/site-packages/netconify/cmdo.py", line 304, in _tty_logout
    self._tty.logout()
  File "/Users/jpriyal/Desktop/developement/netconify_pyEz/venv/lib/python2.7/site-packages/netconify/tty.py", line 115, in logout
    self._logout_state_machine()
  File "/Users/jpriyal/Desktop/developement/netconify_pyEz/venv/lib/python2.7/site-packages/netconify/tty.py", line 150, in _logout_state_machine
    self._logout_state_machine(attempt=attempt + 1)
  File "/Users/jpriyal/Desktop/developement/netconify_pyEz/venv/lib/python2.7/site-packages/netconify/tty.py", line 150, in _logout_state_machine
    self._logout_state_machine(attempt=attempt + 1)
  File "/Users/jpriyal/Desktop/developement/netconify_pyEz/venv/lib/python2.7/site-packages/netconify/tty.py", line 126, in _logout_state_machine
    prompt, found = self.read_prompt()
  File "/Users/jpriyal/Desktop/developement/netconify_pyEz/venv/lib/python2.7/site-packages/netconify/tty_telnet.py", line 77, in read_prompt
    got = self._tn.expect(Terminal._RE_PAT, self.EXPECT_TIMEOUT)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/telnetlib.py", line 655, in expect
    return self._expect_with_select(list, timeout)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/telnetlib.py", line 755, in _expect_with_select
    self.fill_rawq()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/telnetlib.py", line 576, in fill_rawq
    buf = self.sock.recv(50)
socket.error: [Errno 54] Connection reset by peer
vnitinv commented 7 years ago

https://github.com/Juniper/py-junos-netconify/issues/46#issuecomment-249655221