View | Details | Raw Unified | Return to bug 48890
Collapse All | Expand All

(-)a/management/univention-management-console/src/univention/management/console/base.py (-6 / +3 lines)
 Lines 126-132   def query(self, request): Link Here 
126
from univention.management.console.ldap import get_user_connection, reset_cache as reset_ldap_connection_cache
126
from univention.management.console.ldap import get_user_connection, reset_cache as reset_ldap_connection_cache
127
from univention.management.console.config import ucr
127
from univention.management.console.config import ucr
128
from univention.management.console.log import MODULE, CORE
128
from univention.management.console.log import MODULE, CORE
129
from univention.management.console.error import UMC_Error, NotAcceptable, PasswordRequired, LDAP_ServerDown, LDAP_ConnectionFailed, Unauthorized
129
from univention.management.console.error import UMC_Error, NotAcceptable, PasswordRequired, LDAP_ServerDown, LDAP_ConnectionFailed
130
130
131
_ = Translation('univention.management.console').translate
131
_ = Translation('univention.management.console').translate
132
132
 Lines 299-315   def error_handling(self, etype, exc, etraceback): Link Here 
299
		:param exc: The exception instance.
299
		:param exc: The exception instance.
300
		:param etraceback: The exception traceback instance; may be None.
300
		:param etraceback: The exception traceback instance; may be None.
301
		"""
301
		"""
302
		if isinstance(exc, udm_errors.ldapError) and isinstance(getattr(exc, 'original_exception', None), ldap.SERVER_DOWN):
302
		if isinstance(exc, udm_errors.ldapError) and isinstance(getattr(exc, 'original_exception', None), (ldap.SERVER_DOWN, ldap.INVALID_CREDENTIALS)):
303
			exc = exc.original_exception
304
		if isinstance(exc, udm_errors.ldapError) and isinstance(getattr(exc, 'original_exception', None), ldap.INVALID_CREDENTIALS):
305
			exc = exc.original_exception
303
			exc = exc.original_exception
306
		if isinstance(exc, ldap.SERVER_DOWN):
304
		if isinstance(exc, ldap.SERVER_DOWN):
307
			raise LDAP_ServerDown()
305
			raise LDAP_ServerDown()
308
		if isinstance(exc, ldap.CONNECT_ERROR):
306
		if isinstance(exc, (ldap.CONNECT_ERROR, ldap.INVALID_CREDENTIALS)):
309
			raise LDAP_ConnectionFailed(exc)
307
			raise LDAP_ConnectionFailed(exc)
310
		if isinstance(exc, ldap.INVALID_CREDENTIALS):
308
		if isinstance(exc, ldap.INVALID_CREDENTIALS):
311
			reset_ldap_connection_cache()
309
			reset_ldap_connection_cache()
312
			raise Unauthorized
313
310
314
	def __error_handling(self, request, method, etype, exc, etraceback):
311
	def __error_handling(self, request, method, etype, exc, etraceback):
315
		"""
312
		"""
(-)a/management/univention-management-console/src/univention/management/console/error.py (-1 / +1 lines)
 Lines 143-149   def __init__(self, exc): Link Here 
143
143
144
	def _error_msg(self):
144
	def _error_msg(self):
145
		yield _('Cannot connect to the LDAP service.')
145
		yield _('Cannot connect to the LDAP service.')
146
		yield _('Error message: %s') % (self.exc.args[0].get('info', ''),)
146
		yield _('Error message: %s') % (self.exc.args[0].get('info', self.exc.args[0].get('desc', '')),)
147
		yield ''
147
		yield ''
148
		yield _('The following steps can help to solve this problem:')
148
		yield _('The following steps can help to solve this problem:')
149
		if not self._is_master:
149
		if not self._is_master:
(-)a/management/univention-management-console/src/univention/management/console/protocol/session.py (-1 / +4 lines)
 Lines 149-155   class ProcessorBase(Base): Link Here 
149
149
150
	@property
150
	@property
151
	def lo(self):
151
	def lo(self):
152
		return get_machine_connection(write=False)[0]
152
		try:
153
			return get_machine_connection(write=False)[0]
154
		except ldap.INVALID_CREDENTIALS as exc:
155
			CORE.info('Could not get machine connection: %s' % (exc,))
153
156
154
	def __init__(self):
157
	def __init__(self):
155
		Base.__init__(self, 'univention-management-console')
158
		Base.__init__(self, 'univention-management-console')

Return to bug 48890