[fix] Email on certificate renewing failed (#1227)

* [fix] Email on certificate renewing failed

* [enh] Use check_output instead of subprocess

* Update src/yunohost/certificate.py

Co-authored-by: Kayou <pierre.moltess@gmail.com>

* [mod] Use f-string for readability

Co-authored-by: Kayou <pierre.moltess@gmail.com>
Co-authored-by: Alexandre Aubin <alex.aubin@mailoo.org>
This commit is contained in:
ljf (zamentur) 2021-05-23 20:09:48 +02:00 committed by GitHub
parent 0f10b91fa1
commit ea5a6d301f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -949,11 +949,5 @@ def _name_self_CA():
def _tail(n, file_path): def _tail(n, file_path):
stdin, stdout = os.popen2("tail -n %s '%s'" % (n, file_path)) from moulinette.utils.process import check_output
return check_output(f"tail -n {n} '{file_path}'")
stdin.close()
lines = stdout.readlines()
stdout.close()
return "".join(lines)