Merge pull request #83 from autra/fix_service_postgres

Enforce ynh_postgres_test_if_first_run and not yunohost service add
This commit is contained in:
Alexandre Aubin 2020-05-17 23:36:38 +02:00 committed by GitHub
commit 4052440a75
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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"]: