From b69163b57d4b8530c5ab4ac5d40dfb0c0969c045 Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Tue, 9 Aug 2011 00:46:12 +0100 Subject: [PATCH] Fix #1828 : Auth issue with args passed to console --- deluge/ui/console/commander.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/deluge/ui/console/commander.py b/deluge/ui/console/commander.py index 21680c06f..2b51da893 100644 --- a/deluge/ui/console/commander.py +++ b/deluge/ui/console/commander.py @@ -137,10 +137,14 @@ class Commander: print "Could not connect to: %s:%d\n %s"%(host,port,rm) 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: d = client.connect(host,port,username,password) else: d = client.connect() d.addCallback(on_connect) d.addErrback(on_connect_fail) -