Try things the EvenMoreProper way

This commit is contained in:
Peter Eckersley
2016-02-04 19:14:36 -08:00
parent 9cd0d5497f
commit 9f57236bb1
2 changed files with 8 additions and 7 deletions
+1 -7
View File
@@ -864,12 +864,6 @@ def _renewal_conf_files(config):
"""Return /path/to/*.conf in the renewal conf directory"""
return glob.glob(os.path.join(config.renewal_configs_dir, "*.conf"))
def _copy_nsconfig(config):
# Work around https://bugs.python.org/issue1515 for py26 tests :( :(
# https://travis-ci.org/letsencrypt/letsencrypt/jobs/106900743#L3276
ns = copy.deepcopy(config.namespace)
new_config = configuration.NamespaceConfig(ns)
return new_config
def renew(config, unused_plugins):
"""Renew previously-obtained certificates."""
@@ -893,7 +887,7 @@ def renew(config, unused_plugins):
print("Processing " + renewal_file)
# XXX: does this succeed in making a fully independent config object
# each time?
lineage_config = _copy_nsconfig(config)
lineage_config = copy.deepcopy(config)
# Note that this modifies config (to add back the configuration
# elements from within the renewal configuration file).
+7
View File
@@ -1,4 +1,5 @@
"""Let's Encrypt user-supplied configuration."""
import copy
import os
import urlparse
@@ -78,6 +79,12 @@ class NamespaceConfig(object):
return os.path.join(
self.namespace.work_dir, constants.TEMP_CHECKPOINT_DIR)
def __deepcopy__(self, _memo):
# Work around https://bugs.python.org/issue1515 for py26 tests :( :(
# https://travis-ci.org/letsencrypt/letsencrypt/jobs/106900743#L3276
new_ns = copy.deepcopy(self.namespace)
return type(self)(new_ns)
class RenewerConfiguration(object):
"""Configuration wrapper for renewer."""