diff --git a/src/yunohost/certificate.py b/src/yunohost/certificate.py index c01bff84e..633877d7c 100644 --- a/src/yunohost/certificate.py +++ b/src/yunohost/certificate.py @@ -949,11 +949,5 @@ def _name_self_CA(): def _tail(n, file_path): - stdin, stdout = os.popen2("tail -n %s '%s'" % (n, file_path)) - - stdin.close() - - lines = stdout.readlines() - stdout.close() - - return "".join(lines) + from moulinette.utils.process import check_output + return check_output(f"tail -n {n} '{file_path}'")