From 884a764bbb9d519cf492a33121e01d334a0a53d7 Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Mon, 27 Aug 2012 22:39:35 +0000 Subject: Move root.cer to separate rsync module when building test configurations, to avoid warnings about it being tainted. This is really a conflict between needing to support rootd and wanting to make the configuration clean when not running rootd: either we add an extra directory level to the publication structure which we don't use when not running rootd, or we move root.cer somewhere else. Since the latter is simpler except for test configurations which are already generated for us by programs, we do the latter. svn path=/branches/tk274/; revision=4667 --- rpkid/rpki/csv_utils.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'rpkid/rpki/csv_utils.py') diff --git a/rpkid/rpki/csv_utils.py b/rpkid/rpki/csv_utils.py index f7eed414..352aebd9 100644 --- a/rpkid/rpki/csv_utils.py +++ b/rpkid/rpki/csv_utils.py @@ -68,6 +68,12 @@ class csv_reader(object): fields += tuple(None for i in xrange(self.columns - len(fields))) yield fields + def __enter__(self): + return self + + def __exit__(self, type, value, traceback): + self.file.close() + class csv_writer(object): """ Writer object for tab delimited text. We just use the stock CSV @@ -83,6 +89,12 @@ class csv_writer(object): self.file = open(self.renmwo, "w") self.writer = csv.writer(self.file, dialect = csv.get_dialect("excel-tab")) + def __enter__(self): + return self + + def __exit__(self, type, value, traceback): + self.close() + def close(self): """ Close this writer. -- cgit v1.2.3