Noah Wallach
unread,Aug 14, 2014, 3:35:37 AM8/14/14Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to junos-p...@googlegroups.com
I am trying to rollback the configuration with the ncclient, and its failing and not sure why. I am running JUNOS 10.4
here are the relevant lines of code:
--- snip ---
if (exclusive):
conn.lock()
rpc = '''
<rpc>
<load-configuration rollback="1"/>
</rpc>
'''
result = conn.rpc(rpc)
conn.commit()
if (exclusive):
conn.unlock()
conn.close_session()
--- snip ---
here is the trace:
--- snip ---
Traceback (most recent call last):
File "./push.py", line 191, in <module>
connect(hostname, user, password)
File "./push.py", line 183, in connect
conn.commit()
File "/usr/local/lib/python2.7/site-packages/ncclient/manager.py", line 107, in wrapper
return self.execute(op_cls, *args, **kwds)
File "/usr/local/lib/python2.7/site-packages/ncclient/manager.py", line 174, in execute
raise_mode=self._raise_mode).request(*args, **kwds)
File "/usr/local/lib/python2.7/site-packages/ncclient/operations/edit.py", line 145, in request
return self._request(node)
File "/usr/local/lib/python2.7/site-packages/ncclient/operations/rpc.py", line 291, in _request
self._session.send(req)
File "/usr/local/lib/python2.7/site-packages/ncclient/transport/session.py", line 146, in send
raise TransportError('Not connected to NETCONF server')
ncclient.transport.errors.TransportError: Not connected to NETCONF server
--- snip ---