From b0cde49675c86a783b3744479c526275bc462d3a Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sun, 4 Dec 2022 03:30:45 +0100 Subject: [PATCH] packagingv2: deprecate the nginx reload at the end of scripts ... there just no need for it :| --- package_linter.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/package_linter.py b/package_linter.py index 4f91fa1..02dd38c 100755 --- a/package_linter.py +++ b/package_linter.py @@ -2493,7 +2493,7 @@ class Script(TestSuite): ) @test() - def ssowatconf(self): + def ssowatconf_or_nginx_reload(self): # Dirty hack to check only the 10 last lines for ssowatconf # (the "bad" practice being using this at the very end of the script, but some apps legitimately need this in the middle of the script) oldlines = list(self.lines) @@ -2502,6 +2502,13 @@ class Script(TestSuite): yield Warning( "You probably don't need to run 'yunohost app ssowatconf' in the app self. It's supposed to be ran automatically after the script." ) + + if app_packaging_format >= 2 and self.name not in ["change_url", "restore"]: + if self.contains("ynh_systemd_action --service_name=nginx --action=reload"): + yield Warning( + "You should not need to reload nginx at the end of the script ... it's already taken care of by ynh_add_nginx_config" + ) + self.lines = oldlines @test()