Assuming the getpass is the one the from the std lib, I don&#39;t see why you&#39;re overriding getPassword at all.<br><br>according to the API docs, you should be able to get a custom prompt just by adding a prompt parameter:<br>
<a href="http://twistedmatrix.com/documents/8.1.0/api/twisted.conch.ssh.userauth.SSHUserAuthClient.html#getPassword">http://twistedmatrix.com/documents/8.1.0/api/twisted.conch.ssh.userauth.SSHUserAuthClient.html#getPassword</a><br>
<br>and you probably don&#39;t want to call succeed() on the deferred you are returning, since that likely screws up the whole auth calback chain<br><br>if you were looking at this example: <a href="http://www.devshed.com/c/a/Python/SSH-with-Twisted/4/">http://www.devshed.com/c/a/Python/SSH-with-Twisted/4/</a><br>
realize that it might be misleading, as the author overrides the __init__ of his SSHUserAuthClient and passes the password in directly<br>(he does not prompt the user for it)<br><br>...or I could be misunderstanding the way the module works... :)<br>
<br>Good Luck!<br><br>Kevin Horn<br><br><div class="gmail_quote">On Tue, Oct 28, 2008 at 2:36 PM, Andy Fundinger <span dir="ltr">&lt;<a href="mailto:Andy@newworldelectric.com">Andy@newworldelectric.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">For the password problem, I think what you want to do is raise an<br>
exception, which will in turn cause your defereds to call their error<br>
backs. &nbsp;In the error back you can handle the particular error however<br>
you need to. &nbsp;That&#39;s probably something you need to either setup in<br>
the getpass module, alternatively, that may be setup already and just<br>
waiting for you to addErrback() on it.<br>
<br>
- Andy Fundinger<br>
<div class="Ih2E3d"><br>
On Tue, Oct 28, 2008 at 11:19 AM, Jean-Paul Calderone<br>
&lt;<a href="mailto:exarkun@divmod.com">exarkun@divmod.com</a>&gt; wrote:<br>
&gt; On Tue, 28 Oct 2008 10:42:49 -0400 (EDT), Brian Levin &lt;<a href="mailto:b.levin@hvcc.edu">b.levin@hvcc.edu</a>&gt;<br>
&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; I apologizes if these are simple questions. &nbsp;I am a complete newb when it<br>
&gt;&gt; comes to python and twisted. &nbsp;I am trying to pass a command via ssh to a<br>
&gt;&gt; server. &nbsp;I am having 2 problems. &nbsp;I am hoping that someone can help me. &nbsp;I<br>
&gt;&gt; have been unable to find answers in &quot;the google&quot;.<br>
&gt;&gt;<br>
</div><div class="Ih2E3d">&gt;&gt; Problem 2: &nbsp;A bad password or username causes and infinite loop. &nbsp;I need<br>
&gt;&gt; to find a way to cause an error or return a false value when the password or<br>
&gt;&gt; username is bad.<br>
&gt;<br>
&gt; I&#39;m not sure about this one.<br>
&gt;<br>
&gt; Jean-Paul<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Twisted-Python mailing list<br>
&gt; <a href="mailto:Twisted-Python@twistedmatrix.com">Twisted-Python@twistedmatrix.com</a><br>
&gt; <a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python" target="_blank">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a><br>
&gt;<br>
<br>
<br>
<br>
</div><font color="#888888">--<br>
Blog: &nbsp;<a href="http://channel3b.wordpress.com" target="_blank">http://channel3b.wordpress.com</a><br>
Second Life Name: &nbsp;Ciemaar Flintoff<br>
<br>
Watch out for the invisible man.<br>
</font><div><div></div><div class="Wj3C7c"><br>
_______________________________________________<br>
Twisted-Python mailing list<br>
<a href="mailto:Twisted-Python@twistedmatrix.com">Twisted-Python@twistedmatrix.com</a><br>
<a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python" target="_blank">http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python</a><br>
</div></div></blockquote></div><br>