From 7a4d37e320f26b4c09fa4bde25058e74daeb5317 Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Sat, 2 May 2015 08:08:11 +0000 Subject: [PATCH] Don't use sudo in apache plugin. --- letsencrypt/client/plugins/apache/configurator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/letsencrypt/client/plugins/apache/configurator.py b/letsencrypt/client/plugins/apache/configurator.py index ff3842200..33abad3c5 100644 --- a/letsencrypt/client/plugins/apache/configurator.py +++ b/letsencrypt/client/plugins/apache/configurator.py @@ -908,7 +908,7 @@ class ApacheConfigurator(augeas_configurator.AugeasConfigurator): """ try: proc = subprocess.Popen( - ["sudo", self.config.apache_ctl, "configtest"], # TODO: sudo? + [self.config.apache_ctl, "configtest"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) stdout, stderr = proc.communicate() @@ -1046,7 +1046,7 @@ def enable_mod(mod_name, apache_init_script, apache_enmod): try: # Use check_output so the command will finish before reloading # TODO: a2enmod is debian specific... - subprocess.check_call(["sudo", apache_enmod, mod_name], # TODO: sudo? + subprocess.check_call([apache_enmod, mod_name], stdout=open("/dev/null", "w"), stderr=open("/dev/null", "w")) apache_restart(apache_init_script)