Thank you very much Doug. It worked like magic :)<div><br></div><div>Regards</div><div>Ananth<br><br><div class="gmail_quote">On Tue, May 8, 2012 at 8:06 PM, Doug Goldstein <span dir="ltr"><<a href="mailto:cardoe@gentoo.org" target="_blank">cardoe@gentoo.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Tue, May 8, 2012 at 8:24 AM, Ananth <<a href="mailto:cbananth@gmail.com">cbananth@gmail.com</a>> wrote:<br>

> Hi,<br>
> I am trying to connect to libvirt on KVM host from a remote python client,<br>
> using the connection string "qemu+ssh://<IP Address>/system"<br>
> If I setup password less SSH (Public key) between the machines, I am able to<br>
> proceed with the connection. But If I have not setup the public key<br>
> authentication, my code hangs trying to connect to libvirt, and there is a<br>
> prompt for entering password in the shell where the code is running.<br>
><br>
> Is there any way to catch this in an exception and throw an error that<br>
> public key not setup or password not available? Or is it possible to timeout<br>
> and abort the request to connect to the host? Whatever timeout variables<br>
> available online seem to work only for an already active SSH session to<br>
> timeout.<br>
><br>
> Any pointers ?<br>
><br>
<br>
</div></div>You'll want to append ?no_tty=1 to the end of your URI that you pass<br>
to open() or openReadOnly().<br>
<br>
For more info see the docs here:<br>
<a href="http://libvirt.org/remote.html#Remote_URI_parameters" target="_blank">http://libvirt.org/remote.html#Remote_URI_parameters</a><br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Doug Goldstein<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>Regards<br>Ananth<br>
</div>