--- a/server/sqlutils.py Tue Mar 09 19:39:50 2010 +0100
+++ b/server/sqlutils.py Tue Mar 09 19:59:44 2010 +0100
@@ -173,21 +173,29 @@
return cnx
def backup_to_file(self, backupfile):
- for cmd in self.dbhelper.backup_commands(self.dbname, self.dbhost,
- self.dbuser, backupfile,
- dbport=self.dbport,
- keepownership=False):
+ for cmd in self.dbhelper.backup_commands(backupfile=backupfile,
+ keepownership=False,
+ dbname=self.dbname,
+ dbhost=self.dbhost,
+ dbuser=self.dbuser,
+ dbport=self.dbport):
if _run_command(cmd):
if not confirm(' [Failed] Continue anyway?', default='n'):
raise Exception('Failed command: %s' % cmd)
def restore_from_file(self, backupfile, confirm, drop=True):
- for cmd in self.dbhelper.restore_commands(self.dbname, self.dbhost,
- self.dbuser, backupfile,
- self.encoding,
+ if 'dbencoding' in self.dbhelper.restore_commands.im_func.func_code.co_varnames:
+ kwargs = {'dbencoding': self.encoding}
+ else:
+ kwargs = {'encoding': self.encoding}
+ for cmd in self.dbhelper.restore_commands(backupfile=backupfile,
+ keepownership=False,
+ drop=drop,
+ dbname=self.dbname,
+ dbhost=self.dbhost,
+ dbuser=self.dbuser,
dbport=self.dbport,
- keepownership=False,
- drop=drop):
+ **kwargs):
if _run_command(cmd):
if not confirm(' [Failed] Continue anyway?', default='n'):
raise Exception('Failed command: %s' % cmd)
--- a/web/views/authentication.py Tue Mar 09 19:39:50 2010 +0100
+++ b/web/views/authentication.py Tue Mar 09 19:59:44 2010 +0100
@@ -114,8 +114,11 @@
login, authinfo = retreiver.authentication_information(req)
except NoAuthInfo:
continue
- cnx = self._authenticate(req, login, authinfo)
- break
+ try:
+ cnx = self._authenticate(req, login, authinfo)
+ break
+ except ExplicitLogin:
+ continue # the next one may succeed
else:
raise ExplicitLogin()
for retreiver_ in self.authinforetreivers:
@@ -124,7 +127,6 @@
def _authenticate(self, req, login, authinfo):
# remove possibly cached cursor coming from closed connection
- clear_cache(req, 'cursor')
cnxprops = ConnectionProperties(self.vreg.config.repo_method,
close=False, log=self.log_queries)
try: