mirror of
https://github.com/YunoHost/package_linter.git
synced 2024-09-03 20:06:12 +02:00
add check service in install file match with manifest (new services)
This commit is contained in:
parent
e89e613f9e
commit
02ba265abd
1 changed files with 10 additions and 8 deletions
|
@ -315,15 +315,16 @@ class App():
|
||||||
print_error(
|
print_error(
|
||||||
"[YEP-2.1] \"multi_instance\" field must be boolean type values 'true' or 'false' and not string type")
|
"[YEP-2.1] \"multi_instance\" field must be boolean type values 'true' or 'false' and not string type")
|
||||||
|
|
||||||
if "services" in manifest:
|
if "services" in manifest and self.scripts["install"].exists:
|
||||||
services = ("nginx", "mysql", "uwsgi", "metronome",
|
|
||||||
|
known_services = ("nginx", "mysql", "uwsgi", "metronome",
|
||||||
"php5-fpm", "php7.0-fpm", "php-fpm",
|
"php5-fpm", "php7.0-fpm", "php-fpm",
|
||||||
"postfix", "dovecot", "rspamd")
|
"postfix", "dovecot", "rspamd")
|
||||||
|
|
||||||
for service in manifest["services"]:
|
for service in manifest["services"]:
|
||||||
if service not in services:
|
if service not in known_services:
|
||||||
# FIXME : wtf is it supposed to mean ...
|
if not self.scripts["install"].contains("yunohost service add %s" % service):
|
||||||
print_warning("[YEP-2.1] " + service + " service may not exist")
|
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"]:
|
||||||
|
|
||||||
|
@ -379,6 +380,7 @@ class Script():
|
||||||
lines = '\n'.join(lines).replace("\\\n", "").split("\n")
|
lines = '\n'.join(lines).replace("\\\n", "").split("\n")
|
||||||
|
|
||||||
for line in lines:
|
for line in lines:
|
||||||
|
|
||||||
try:
|
try:
|
||||||
line = shlex.split(line, True)
|
line = shlex.split(line, True)
|
||||||
yield line
|
yield line
|
||||||
|
|
Loading…
Reference in a new issue