Univention Bugzilla – Attachment 6097 Details for
Bug 35700
Traceback when using non-valid search values (= pkgdb unusable)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
pkgdb.patch
pkgdb.patch (text/plain), 1.88 KB, created by
Florian Best
on 2014-09-08 10:13:22 CEST
(
hide
)
Description:
pkgdb.patch
Filename:
MIME Type:
Creator:
Florian Best
Created:
2014-09-08 10:13:22 CEST
Size:
1.88 KB
patch
obsolete
>Index: umc/python/pkgdb/__init__.py >=================================================================== >--- umc/python/pkgdb/__init__.py (Revision 53395) >+++ umc/python/pkgdb/__init__.py (Arbeitskopie) >@@ -201,7 +201,8 @@ > > PAGES = ('systems', 'packages') > >-SERVER_NOT_RUNNING_MSG = _('Maybe the PostgreSQL server is not running.\nIt can be started in the UMC module "System services".') >+def _server_not_running_msg(): >+ return _('Maybe the PostgreSQL server is not running.\nIt can be started in the UMC module "System services".') > > class Instance(Base): > def init(self): >@@ -218,7 +219,7 @@ > self.connect() > else: > self.test_connection() >- func(self, *args, **kwargs) >+ return func(self, *args, **kwargs) > > return _connect > >@@ -227,8 +228,8 @@ > try: > self.dbConnection = updb.open_database_connection(self.ucr, pkgdbu=True) > except pgdb.InternalError as ex: >- MODULE.error('Could not establish connection to the PostgreSQL server: %s' % ex) >- raise UMC_CommandError(_('Could not establish connection to the database.\n\n%s') % SERVER_NOT_RUNNING_MSG) >+ MODULE.error('Could not establish connection to the PostgreSQL server: %s' % (ex,)) >+ raise UMC_CommandError(_('Could not establish connection to the database.\n\n%s') % (_server_not_running_msg(),)) > else: > self.cursor = self.dbConnection.cursor() > >@@ -237,9 +238,12 @@ > try: > self.cursor.execute('SELECT TRUE') > except pgdb.OperationalError as ex: >- MODULE.error('Connection to the PostgreSQL server lost: %s' % ex) >+ MODULE.error('Connection to the PostgreSQL server lost: %s' % (ex,)) > self.dbConnection = None >- raise UMC_CommandError(_('Connection to the dabase lost.\n\n%s') % SERVER_NOT_RUNNING_MSG) >+ try: >+ self.connect() >+ except UMC_CommandError: >+ raise UMC_CommandError(_('Connection to the dabase lost.\n\n%s') % (_server_not_running_msg(),)) > > @simple_response > def reinit(self):
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 35700
: 6097