From c9b9b0edda27c3be3173fdcda0e98bcbd4995b3c Mon Sep 17 00:00:00 2001 From: Noah Swartz Date: Wed, 23 Dec 2015 10:31:31 -0800 Subject: [PATCH 1/3] add debug statement --- letsencrypt-apache/letsencrypt_apache/configurator.py | 1 + 1 file changed, 1 insertion(+) diff --git a/letsencrypt-apache/letsencrypt_apache/configurator.py b/letsencrypt-apache/letsencrypt_apache/configurator.py index f72492ac2..1d86da066 100644 --- a/letsencrypt-apache/letsencrypt_apache/configurator.py +++ b/letsencrypt-apache/letsencrypt_apache/configurator.py @@ -1271,6 +1271,7 @@ class ApacheConfigurator(augeas_configurator.AugeasConfigurator): """ self.config_test() + logger.debug(self.aug.view_config_changes(self)) self._reload() def _reload(self): From 49f36f8071b7804b235e7b80be3bd7b8a9d2754f Mon Sep 17 00:00:00 2001 From: Noah Swartz Date: Wed, 23 Dec 2015 14:57:14 -0800 Subject: [PATCH 2/3] also debug the written conf file --- letsencrypt-apache/letsencrypt_apache/tls_sni_01.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/letsencrypt-apache/letsencrypt_apache/tls_sni_01.py b/letsencrypt-apache/letsencrypt_apache/tls_sni_01.py index 4284e240c..def3b18a6 100644 --- a/letsencrypt-apache/letsencrypt_apache/tls_sni_01.py +++ b/letsencrypt-apache/letsencrypt_apache/tls_sni_01.py @@ -104,8 +104,9 @@ class ApacheTlsSni01(common.TLSSNI01): self.configurator.reverter.register_file_creation( True, self.challenge_conf) - with open(self.challenge_conf, "w") as new_conf: + with open(self.challenge_conf, "rw") as new_conf: new_conf.write(config_text) + logger.debug(new_conf.read()) return addrs From ea2c86b9265bc05a750fcbfe999ed2f9ea918878 Mon Sep 17 00:00:00 2001 From: Noah Swartz Date: Wed, 23 Dec 2015 16:08:33 -0800 Subject: [PATCH 3/3] fixed linting and added logger --- letsencrypt-apache/letsencrypt_apache/configurator.py | 2 +- letsencrypt-apache/letsencrypt_apache/tls_sni_01.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/letsencrypt-apache/letsencrypt_apache/configurator.py b/letsencrypt-apache/letsencrypt_apache/configurator.py index 1d86da066..1baa06128 100644 --- a/letsencrypt-apache/letsencrypt_apache/configurator.py +++ b/letsencrypt-apache/letsencrypt_apache/configurator.py @@ -1271,7 +1271,7 @@ class ApacheConfigurator(augeas_configurator.AugeasConfigurator): """ self.config_test() - logger.debug(self.aug.view_config_changes(self)) + logger.debug(self.reverter.view_config_changes()) self._reload() def _reload(self): diff --git a/letsencrypt-apache/letsencrypt_apache/tls_sni_01.py b/letsencrypt-apache/letsencrypt_apache/tls_sni_01.py index def3b18a6..a770804d1 100644 --- a/letsencrypt-apache/letsencrypt_apache/tls_sni_01.py +++ b/letsencrypt-apache/letsencrypt_apache/tls_sni_01.py @@ -1,12 +1,14 @@ """A class that performs TLS-SNI-01 challenges for Apache""" import os +import logging from letsencrypt.plugins import common from letsencrypt_apache import obj from letsencrypt_apache import parser +logger = logging.getLogger(__name__) class ApacheTlsSni01(common.TLSSNI01): """Class that performs TLS-SNI-01 challenges within the Apache configurator @@ -104,9 +106,9 @@ class ApacheTlsSni01(common.TLSSNI01): self.configurator.reverter.register_file_creation( True, self.challenge_conf) - with open(self.challenge_conf, "rw") as new_conf: + logger.debug("writing a config file with text: %s", config_text) + with open(self.challenge_conf, "w") as new_conf: new_conf.write(config_text) - logger.debug(new_conf.read()) return addrs