|
46 |
import notifier |
46 |
import notifier |
47 |
import notifier.threads |
47 |
import notifier.threads |
48 |
import apt # for independent apt.Cache |
48 |
import apt # for independent apt.Cache |
|
|
49 |
import ldap |
49 |
|
50 |
|
50 |
# univention |
51 |
# univention |
51 |
from univention.lib.package_manager import PackageManager, LockError |
52 |
from univention.lib.package_manager import PackageManager, LockError |
|
59 |
import univention.management.console as umc |
60 |
import univention.management.console as umc |
60 |
import univention.management.console.modules as umcm |
61 |
import univention.management.console.modules as umcm |
61 |
from univention.appcenter import get_action, AppManager |
62 |
from univention.appcenter import get_action, AppManager |
|
|
63 |
from univention.appcenter.actions import Abort |
62 |
from univention.appcenter.utils import docker_is_running, call_process |
64 |
from univention.appcenter.utils import docker_is_running, call_process |
63 |
from univention.appcenter.log import get_base_logger, log_to_logfile |
65 |
from univention.appcenter.log import get_base_logger, log_to_logfile |
64 |
from univention.appcenter.ucr import ucr_instance, ucr_save |
66 |
from univention.appcenter.ucr import ucr_instance, ucr_save |
|
160 |
get_base_logger().getChild('actions.remove.progress').addHandler(percentage) |
162 |
get_base_logger().getChild('actions.remove.progress').addHandler(percentage) |
161 |
|
163 |
|
162 |
def error_handling(self, exc, etype, etraceback): |
164 |
def error_handling(self, exc, etype, etraceback): |
|
|
165 |
if isinstance(exc, Abort) and exc.exc_info: |
166 |
self.error_handling(*exc.exc_info) |
167 |
if isinstance(exc, ldap.INVALID_CREDENTIALS): |
168 |
pass # TODO: raise umcm.UMC_Error(userfriendly_message, status=500) |
163 |
if isinstance(exc, (SystemError, AppcenterServerContactFailed)): |
169 |
if isinstance(exc, (SystemError, AppcenterServerContactFailed)): |
164 |
MODULE.error(str(exc)) |
170 |
MODULE.error(str(exc)) |
165 |
raise umcm.UMC_Error(str(exc), status=500) |
171 |
raise umcm.UMC_Error(str(exc), status=500) |
|
|
172 |
super(Instance, self).error_handling(exc, etype, etraceback) |
166 |
|
173 |
|
167 |
@simple_response |
174 |
@simple_response |
168 |
def version(self): |
175 |
def version(self): |