commit 74494091a09bc392d767ded9ff3af26b4e69a7e9 Author: Arturo Filastò art@fuffa.org Date: Mon Sep 29 13:42:25 2014 +0200
Set default report file path to include country code.
Fix calling of report_file_name --- oonib/report/handlers.py | 2 +- oonib/test/test_report.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/oonib/report/handlers.py b/oonib/report/handlers.py index 13cc06e..9aa5df9 100644 --- a/oonib/report/handlers.py +++ b/oonib/report/handlers.py @@ -28,7 +28,7 @@ def report_file_name(archive_dir, report_details): minute=timestamp.strftime("%M"), second=timestamp.strftime("%S") ) - report_file_template = "{test_name}-{iso8601_timestamp}-{probe_asn}-probe.yamloo" + report_file_template = "{probe_cc}/{test_name}-{iso8601_timestamp}-{probe_asn}-probe.yamloo" if config.main.report_file_template: report_file_template = config.main.report_file_template dst_filename = os.path.join(archive_dir, report_file_template.format(**keys)) diff --git a/oonib/test/test_report.py b/oonib/test/test_report.py index 59c539f..9da8b08 100644 --- a/oonib/test/test_report.py +++ b/oonib/test/test_report.py @@ -197,8 +197,7 @@ class TestReport(HandlerTestCase):
response = yield self.request('/report/%s/close' % report_id, "POST")
- written_report_path = os.path.join(written_report_header['probe_cc'], - report_file_name(written_report_header)) + written_report_path = report_file_name(".", written_report_header) with open(written_report_path) as f: self.filenames.add(written_report_path) written_report = yaml.safe_load_all(f)