do not error if remoteuser is not configured

Signed-off-by: Mark Oteiza <mvoteiza@udel.edu>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
Mark Oteiza 2014-05-31 10:42:25 -04:00 committed by Nicolas Sebrecht
parent 1746676af8
commit a629b4e0e7

View File

@ -156,6 +156,7 @@ class IMAPRepository(BaseRepository):
if user != None: if user != None:
return localeval.eval(user) return localeval.eval(user)
if self.config.has_option(self.getsection(), 'remoteuser'):
user = self.getconf('remoteuser') user = self.getconf('remoteuser')
if user != None: if user != None:
return user return user
@ -284,7 +285,7 @@ class IMAPRepository(BaseRepository):
raise raise
else: else:
if netrcentry: if netrcentry:
user = self.getconf('remoteuser') user = self.getuser()
if user == None or user == netrcentry[0]: if user == None or user == netrcentry[0]:
return netrcentry[2] return netrcentry[2]
# 5. read password from /etc/netrc # 5. read password from /etc/netrc
@ -295,7 +296,7 @@ class IMAPRepository(BaseRepository):
raise raise
else: else:
if netrcentry: if netrcentry:
user = self.getconf('remoteuser') user = self.getuser()
if user == None or user == netrcentry[0]: if user == None or user == netrcentry[0]:
return netrcentry[2] return netrcentry[2]
# no strategy yielded a password! # no strategy yielded a password!