From f5053ba8af122ac91b60e833b0c1c6576e226825 Mon Sep 17 00:00:00 2001 From: Jakub Warmuz Date: Wed, 4 Nov 2015 20:12:39 +0000 Subject: [PATCH] constants.AUGEAS_LENS_DIR --- letsencrypt-apache/MANIFEST.in | 2 +- .../letsencrypt_apache/augeas_configurator.py | 10 +++++----- .../letsencrypt_apache/{ => augeas_lens}/httpd.aug | 0 letsencrypt-apache/letsencrypt_apache/constants.py | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) rename letsencrypt-apache/letsencrypt_apache/{ => augeas_lens}/httpd.aug (100%) diff --git a/letsencrypt-apache/MANIFEST.in b/letsencrypt-apache/MANIFEST.in index 15d5af8cd..933cc10ac 100644 --- a/letsencrypt-apache/MANIFEST.in +++ b/letsencrypt-apache/MANIFEST.in @@ -3,4 +3,4 @@ include README.rst recursive-include docs * recursive-include letsencrypt_apache/tests/testdata * include letsencrypt_apache/options-ssl-apache.conf -include letsencrypt_apache/httpd.aug +recursive-include letsencrypt_apache/augeas_lens *.aug diff --git a/letsencrypt-apache/letsencrypt_apache/augeas_configurator.py b/letsencrypt-apache/letsencrypt_apache/augeas_configurator.py index 53d1bc017..9b7e288d4 100644 --- a/letsencrypt-apache/letsencrypt_apache/augeas_configurator.py +++ b/letsencrypt-apache/letsencrypt_apache/augeas_configurator.py @@ -30,11 +30,11 @@ class AugeasConfigurator(common.Plugin): def __init__(self, *args, **kwargs): super(AugeasConfigurator, self).__init__(*args, **kwargs) - # Set Augeas flags to not save backup (we do it ourselves) - # Set Augeas to not load anything by default - my_flags = augeas.Augeas.NONE | augeas.Augeas.NO_MODL_AUTOLOAD - my_dir = os.path.dirname(constants.AUGEAS_HTTPD_LENS) - self.aug = augeas.Augeas(loadpath=my_dir, flags=my_flags) + self.aug = augeas.Augeas( + loadpath=constants.AUGEAS_LENS_DIR, + # Do not save backup (we do it ourselves), do not load + # anything by default + flags=(augeas.Augeas.NONE | augeas.Augeas.NO_MODL_AUTOLOAD)) self.save_notes = "" # See if any temporary changes need to be recovered diff --git a/letsencrypt-apache/letsencrypt_apache/httpd.aug b/letsencrypt-apache/letsencrypt_apache/augeas_lens/httpd.aug similarity index 100% rename from letsencrypt-apache/letsencrypt_apache/httpd.aug rename to letsencrypt-apache/letsencrypt_apache/augeas_lens/httpd.aug diff --git a/letsencrypt-apache/letsencrypt_apache/constants.py b/letsencrypt-apache/letsencrypt_apache/constants.py index 0a1053832..1c17eacc3 100644 --- a/letsencrypt-apache/letsencrypt_apache/constants.py +++ b/letsencrypt-apache/letsencrypt_apache/constants.py @@ -20,9 +20,9 @@ MOD_SSL_CONF_SRC = pkg_resources.resource_filename( """Path to the Apache mod_ssl config file found in the Let's Encrypt distribution.""" -AUGEAS_HTTPD_LENS = pkg_resources.resource_filename( - "letsencrypt_apache", "httpd.aug") -"""Path to the Augeas lens""" +AUGEAS_LENS_DIR = pkg_resources.resource_filename( + "letsencrypt_apache", "augeas_lens") +"""Path to the Augeas lens directory""" REWRITE_HTTPS_ARGS = [ "^", "https://%{SERVER_NAME}%{REQUEST_URI}", "[L,QSA,R=permanent]"]