From 0af2886d628cca31c2926e5cb97b7c29501eed67 Mon Sep 17 00:00:00 2001 From: Mikhail Sandakov Date: Fri, 2 Aug 2024 15:53:11 +0300 Subject: [PATCH] Do not delete the action data JSON file if an error occurs during the final stage --- pleskdistup/common/src/action.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pleskdistup/common/src/action.py b/pleskdistup/common/src/action.py index 24db1ee..25aa25c 100644 --- a/pleskdistup/common/src/action.py +++ b/pleskdistup/common/src/action.py @@ -393,7 +393,9 @@ def __enter__(self): return self def __exit__(self, *kwargs): - if os.path.exists(self.path_to_actions_data): + # Do not remove the actions data if an error occurs because + # customer will likely want to retry after correcting the error on their end + if self.error is not None and os.path.exists(self.path_to_actions_data): os.remove(self.path_to_actions_data) def _get_flow(self) -> typing.Dict[str, typing.List[ActiveAction]]: