mirror of
https://github.com/YunoHost/package_linter.git
synced 2024-09-03 20:06:12 +02:00
Try/except because flarum has a nonutf8 file >_>
This commit is contained in:
parent
bd199390cd
commit
6e0c314098
1 changed files with 12 additions and 2 deletions
|
@ -570,7 +570,12 @@ class Configurations(TestSuite):
|
||||||
if not filename.endswith(".service"):
|
if not filename.endswith(".service"):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
try:
|
||||||
content = open(app.path + "/conf/" + filename).read()
|
content = open(app.path + "/conf/" + filename).read()
|
||||||
|
except Exception as e:
|
||||||
|
yield Warning("Can't open/read %s : %s" % (filename, e))
|
||||||
|
return
|
||||||
|
|
||||||
matches = re.findall(r"^ *(User|Group)=(\S+)", content, flags=re.MULTILINE)
|
matches = re.findall(r"^ *(User|Group)=(\S+)", content, flags=re.MULTILINE)
|
||||||
if not any(match[0] == "User" for match in matches):
|
if not any(match[0] == "User" for match in matches):
|
||||||
yield Warning("You should specify a User= directive in the systemd config !")
|
yield Warning("You should specify a User= directive in the systemd config !")
|
||||||
|
@ -588,7 +593,12 @@ class Configurations(TestSuite):
|
||||||
if not filename.startswith("php") or not filename.endswith(".conf"):
|
if not filename.startswith("php") or not filename.endswith(".conf"):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
try:
|
||||||
content = open(app.path + "/conf/" + filename).read()
|
content = open(app.path + "/conf/" + filename).read()
|
||||||
|
except Exception as e:
|
||||||
|
yield Warning("Can't open/read %s : %s" % (filename, e))
|
||||||
|
return
|
||||||
|
|
||||||
matches = re.findall(r"^ *(user|group) = (\S+)", content, flags=re.MULTILINE)
|
matches = re.findall(r"^ *(user|group) = (\S+)", content, flags=re.MULTILINE)
|
||||||
if not any(match[0] == "user" for match in matches):
|
if not any(match[0] == "user" for match in matches):
|
||||||
yield Warning("You should at least specify a user = directive in your php conf file")
|
yield Warning("You should at least specify a user = directive in your php conf file")
|
||||||
|
|
Loading…
Reference in a new issue