Merge pull request #154 from YunoHost/Do-not-delete-logs-on-app-removal

Do not delete logs on app removal
This commit is contained in:
Alexandre Aubin 2024-06-20 22:59:22 +02:00 committed by GitHub
commit 2ba302254a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3120,6 +3120,13 @@ class Script(TestSuite):
"You should not use `ynh_script_progression` in _common.sh because it will produce warnings when trying to install the application."
)
@test(only=["remove"])
def no_log_remove(self):
if self.containsregex("(ynh_secure_remove|ynh_safe_rm|rm).*(\/var\/log\/)"):
yield Warning(
"Do not delete logs on app removal, else they will be erased if the app upgrade fails. This is handled by the core."
)
def main():
if len(sys.argv) < 2: