Fix #1828 : Auth issue with args passed to console
This commit is contained in:
parent
006624f568
commit
b69163b57d
|
@ -137,10 +137,14 @@ class Commander:
|
||||||
print "Could not connect to: %s:%d\n %s"%(host,port,rm)
|
print "Could not connect to: %s:%d\n %s"%(host,port,rm)
|
||||||
self.do_command("quit")
|
self.do_command("quit")
|
||||||
|
|
||||||
|
if not username and host in ("127.0.0.1", "localhost"):
|
||||||
|
# No username was provided and it's the localhost, so we can try
|
||||||
|
# to grab the credentials from the auth file.
|
||||||
|
from deluge.ui.common import get_localhost_auth
|
||||||
|
username, password = get_localhost_auth()
|
||||||
if host:
|
if host:
|
||||||
d = client.connect(host,port,username,password)
|
d = client.connect(host,port,username,password)
|
||||||
else:
|
else:
|
||||||
d = client.connect()
|
d = client.connect()
|
||||||
d.addCallback(on_connect)
|
d.addCallback(on_connect)
|
||||||
d.addErrback(on_connect_fail)
|
d.addErrback(on_connect_fail)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue