appsv2: revert commit that adds a bunch of warning about apt/database consistency, it's more relevant to have them in package linter instead

This commit is contained in:
Alexandre Aubin 2023-02-20 18:03:32 +01:00
parent 2b70ccbf40
commit 63f0f08421

View file

@ -46,36 +46,6 @@ class AppResourceManager:
if "resources" not in self.wanted: if "resources" not in self.wanted:
self.wanted["resources"] = {} self.wanted["resources"] = {}
if self.wanted["resources"]:
self.validate()
def validate(self):
resources = self.wanted["resources"]
if "database" in list(resources.keys()):
if "apt" not in list(resources.keys()):
logger.error(
" ! Packagers: having an 'apt' resource is mandatory when using a 'database' resource, to also install postgresql/mysql if needed"
)
else:
if list(resources.keys()).index("database") < list(
resources.keys()
).index("apt"):
logger.error(
" ! Packagers: the 'apt' resource should be placed before the 'database' resource, to install postgresql/mysql if needed *before* provisioning the database"
)
dbtype = resources["database"]["type"]
apt_packages = resources["apt"].get("packages", "").split(", ")
if dbtype == "mysql" and "mariadb-server" not in apt_packages:
logger.error(
" ! Packagers : when using a mysql database, you should add mariadb-server in apt dependencies. Even though it's currently installed by default in YunoHost installations, it might not be in the future !"
)
if dbtype == "postgresql" and "postgresql" not in apt_packages:
logger.error(
" ! Packagers : when using a postgresql database, you should add postgresql in apt dependencies."
)
def apply( def apply(
self, rollback_and_raise_exception_if_failure, operation_logger=None, **context self, rollback_and_raise_exception_if_failure, operation_logger=None, **context
): ):