Paramiko and reading buffer stuck

602 views
Skip to first unread message

Kashif Rana

unread,
May 11, 2015, 12:43:15 AM5/11/15
to junos-p...@googlegroups.com

Hello

Through Paramiko SSH connection, I am sending the below command and after reading the buffer, it stuck. How can I get out of this?

admin@vSRX-01>
>>> remote_conn.send("\n")
1
>>> output = remote_conn.recv(1000)








Rick Sherman

unread,
May 11, 2015, 9:59:41 AM5/11/15
to junos-p...@googlegroups.com, kashif...@gmail.com
Hi Kashif,

PyEZ abstracts the paramiko connection.  If you are working with the shell you can use start_shell:  http://junos-pyez.readthedocs.org/en/1.1.2/jnpr.junos.utils.html#module-jnpr.junos.utils.start_shell

-Rick

Kirk Byers

unread,
May 14, 2015, 8:47:46 PM5/14/15
to junos-p...@googlegroups.com
To answer you Paramiko question...you can use the Paramiko recv_ready() method to see if you have any data available to be read (so you don't get stuck waiting for data).


Kirk

Kashif Rana

unread,
May 19, 2015, 5:45:21 AM5/19/15
to Kirk Byers, junos-p...@googlegroups.com
Thanks Kirk. Happy to see you here :) Many times, I am in this situation. I send the command and use the recv_ready() method to check for data availability but then once I read using recv() method, I am getting stuck. 

--
You received this message because you are subscribed to a topic in the Google Groups "Junos Python EZ" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/junos-python-ez/PbpurzeKNxY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to junos-python-...@googlegroups.com.
Visit this group at http://groups.google.com/group/junos-python-ez.
To view this discussion on the web visit https://groups.google.com/d/msgid/junos-python-ez/ab1512f4-f70f-40cb-b0bc-bfd8d95753eb%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages