Enforce ynh_postgres_test_if_first_run and not yunohost service add

This commit is contained in:
Augustin Trancart 2020-05-17 22:48:20 +02:00
parent 53894076da
commit 726bf2a81b

View file

@ -635,7 +635,11 @@ class App():
for service in manifest["services"]: for service in manifest["services"]:
if service not in known_services: if service not in known_services:
if not self.scripts["install"].contains("yunohost service add %s" % service): if service == 'postgresql':
if not self.scripts["install"].contains('ynh_psql_test_if_first_run')\
or not self.scripts["restore"].contains('ynh_psql_test_if_first_run'):
print_error("[YEP-2.1?] postgresql service present in the manifest, install and restore scripts must call ynh_psql_test_if_first_run")
elif not self.scripts["install"].contains("yunohost service add %s" % service):
print_error("[YEP-2.1?] " + service + " service not installed by the install file but present in the manifest") print_error("[YEP-2.1?] " + service + " service not installed by the install file but present in the manifest")
if "install" in manifest["arguments"]: if "install" in manifest["arguments"]: