Add an error check when reading the auth file

This commit is contained in:
Andrew Resch 2008-12-11 09:31:37 +00:00
parent c32eddfc48
commit c0bf133ab8
1 changed files with 6 additions and 1 deletions

View File

@ -131,7 +131,12 @@ def get_localhost_auth_uri(uri):
if os.path.exists(auth_file):
u = urlparse.urlsplit(uri)
for line in open(auth_file):
username, password = line.split(":")
try:
username, password = line.split(":")
except ValueError, e:
log.error("Error with auth entry %s", line)
continue
if username == "localclient":
# We use '127.0.0.1' in place of 'localhost' just incase this isn't defined properly
hostname = u.hostname.replace("localhost", "127.0.0.1")