From 725d05e8ac9f624ffa6798181ab7198e9923b803 Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Sun, 23 Nov 2014 21:02:53 +0100 Subject: [PATCH] Less generic exception for subprocess.check_call. https://docs.python.org/2/library/subprocess.html#exceptions --- letsencrypt/client/apache_configurator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/letsencrypt/client/apache_configurator.py b/letsencrypt/client/apache_configurator.py index 9612b5872..28b9c9471 100644 --- a/letsencrypt/client/apache_configurator.py +++ b/letsencrypt/client/apache_configurator.py @@ -928,7 +928,7 @@ LogLevel warn \n\ subprocess.check_call(["sudo", "a2enmod", mod_name], stdout=open("/dev/null", 'w'), stderr=open("/dev/null", 'w')) # Hopefully this waits for output subprocess.check_call(["sudo", "/etc/init.d/apache2", "restart"], stdout=open("/dev/null", 'w'), stderr=open("/dev/null", 'w')) - except Exception as e: + except (OSError, subprocess.CalledProcessError) as e: logger.error("Error enabling mod_" + mod_name) logger.error("Exception: %s" % str(e)) sys.exit(1)