mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
appsv2: fix resource provisioning scripts picking up already-closed operation logger, resulting in confusing debugging output
This commit is contained in:
parent
4dfff20140
commit
888593ad22
1 changed files with 4 additions and 3 deletions
|
@ -225,9 +225,10 @@ ynh_abort_if_errors
|
|||
|
||||
from yunohost.log import OperationLogger
|
||||
|
||||
if OperationLogger._instances:
|
||||
# FIXME ? : this is an ugly hack :(
|
||||
operation_logger = OperationLogger._instances[-1]
|
||||
# FIXME ? : this is an ugly hack :(
|
||||
active_operation_loggers = [o for o in OperationLogger._instances if o.ended_at is None]
|
||||
if active_operation_loggers:
|
||||
operation_logger = active_operation_loggers[-1]
|
||||
else:
|
||||
operation_logger = OperationLogger(
|
||||
"resource_snippet", [("app", self.app)], env=env_
|
||||
|
|
Loading…
Add table
Reference in a new issue