Merge pull request #2268 from letsencrypt/fix-2254

Ignore renewal configs that don't end in .conf
This commit is contained in:
Peter Eckersley
2016-01-25 14:07:04 -08:00
3 changed files with 11 additions and 0 deletions
+2
View File
@@ -194,6 +194,8 @@ def _find_duplicative_certs(config, domains):
le_util.make_or_verify_dir(configs_dir, mode=0o755, uid=os.geteuid())
for renewal_file in os.listdir(configs_dir):
if not renewal_file.endswith(".conf"):
continue
try:
full_path = os.path.join(configs_dir, renewal_file)
candidate_lineage = storage.RenewableCert(full_path, cli_config)
+2
View File
@@ -172,6 +172,8 @@ def main(cli_args=sys.argv[1:]):
constants.CONFIG_DIRS_MODE, uid)
for renewal_file in os.listdir(cli_config.renewal_configs_dir):
if not renewal_file.endswith(".conf"):
continue
print("Processing " + renewal_file)
try:
# TODO: Before trying to initialize the RenewableCert object,
+7
View File
@@ -68,6 +68,13 @@ class BaseRenewableCertTest(unittest.TestCase):
config.write()
self.config = config
# We also create a file that isn't a renewal config in the same
# location to test that logic that reads in all-and-only renewal
# configs will ignore it and NOT attempt to parse it.
junk = open(os.path.join(self.tempdir, "renewal", "IGNORE.THIS"), "w")
junk.write("This file should be ignored!")
junk.close()
self.defaults = configobj.ConfigObj()
self.test_rc = storage.RenewableCert(config.filename, self.cli_config)