From d4f47e920b26897c01ed7443ee9ba2decd875338 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Wed, 28 Aug 2019 21:51:22 +0200 Subject: [PATCH] Fix cleanup --- .../certbot_integration_tests/apache_tests/context.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/certbot-ci/certbot_integration_tests/apache_tests/context.py b/certbot-ci/certbot_integration_tests/apache_tests/context.py index 6001632d1..0576650aa 100644 --- a/certbot-ci/certbot_integration_tests/apache_tests/context.py +++ b/certbot-ci/certbot_integration_tests/apache_tests/context.py @@ -1,3 +1,4 @@ +import errno import os import signal import subprocess @@ -42,4 +43,9 @@ class IntegrationTestsContext(certbot_context.IntegrationTestsContext): pid = None if pid: - os.kill(pid, signal.SIGTERM) + try: + os.kill(pid, signal.SIGTERM) + except OSError as err: + # Ignore "No such process" error, Apache may already be stopped. + if err.errno != errno.ESRCH: + raise