diff options
author | Rob Austein <sra@hactrn.net> | 2016-04-23 15:03:57 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2016-04-23 15:03:57 +0000 |
commit | 293522be610014907edcd03943b85de9dda9c37b (patch) | |
tree | 3c92ea35b2459fadfe0e7b7b8b478113a6e1d920 /rpki/pubdb | |
parent | 9b85950eca0020b4c264904b5eb60719cc6d8339 (diff) |
Add yamltest code to set up TAL and root certificate correctly under
new scheme. Rewrite pubd code which was whacking top-level
certificate files with names other than "root.cer".
svn path=/branches/tk705/; revision=6380
Diffstat (limited to 'rpki/pubdb')
-rw-r--r-- | rpki/pubdb/models.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/rpki/pubdb/models.py b/rpki/pubdb/models.py index b923b3f7..21508bed 100644 --- a/rpki/pubdb/models.py +++ b/rpki/pubdb/models.py @@ -96,12 +96,6 @@ class Session(models.Model): uuid = models.CharField(unique = True, max_length=36) serial = models.BigIntegerField() - ## @var keep_these_files - # Filenames which should not be deleted during cleanup. - # Expected use is to allow us to store a root certificate - # in in the RRDP base directory. - - keep_these_files = set(["root.cer", "root.tal"]) def new_delta(self, expires): """ @@ -190,7 +184,11 @@ class Session(models.Model): Write current RRDP files to disk, clean up old files and directories. """ - current_filenames = self.keep_these_files.copy() + if os.path.isdir(rrdp_publication_base): + current_filenames = set(fn for fn in os.listdir(rrdp_publication_base) + if fn.endswith(".cer") or fn.endswith(".tal")) + else: + current_filenames = set() snapshot_hash = self.write_snapshot_file(rrdp_publication_base) current_filenames.add(self.snapshot_fn) |