mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
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:
parent
2b70ccbf40
commit
63f0f08421
1 changed files with 0 additions and 30 deletions
|
@ -46,36 +46,6 @@ class AppResourceManager:
|
|||
if "resources" not in self.wanted:
|
||||
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(
|
||||
self, rollback_and_raise_exception_if_failure, operation_logger=None, **context
|
||||
):
|
||||
|
|
Loading…
Add table
Reference in a new issue