[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [oonib/master] Pass report_id to get correct file path
commit 1617489c7d6175e45153a79ee5b1bcbd227948b8
Author: Arturo Filastò <arturo@xxxxxxxxxxx>
Date: Mon Feb 15 19:21:18 2016 +0100
Pass report_id to get correct file path
---
oonib/report/handlers.py | 4 ++--
oonib/test/test_report.py | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/oonib/report/handlers.py b/oonib/report/handlers.py
index b27a943..3e308e5 100644
--- a/oonib/report/handlers.py
+++ b/oonib/report/handlers.py
@@ -39,8 +39,8 @@ def report_file_name(archive_dir, report_details,
report_id=report_id
)
report_file_template = "{iso8601_timestamp}-{test_name}-{report_id}-{probe_asn}-{probe_cc}-probe-0.2.0.{ext}"
- if config.main.report_file_template:
- report_file_template = config.main.report_file_template
+ if config.main.get('report_file_template'):
+ report_file_template = config.main['report_file_template']
dst_filename = os.path.join(archive_dir, report_file_template.format(**keys))
dst_dir = os.path.dirname(dst_filename)
if not os.path.exists(dst_dir):
diff --git a/oonib/test/test_report.py b/oonib/test/test_report.py
index 55f78be..5e1712b 100644
--- a/oonib/test/test_report.py
+++ b/oonib/test/test_report.py
@@ -178,7 +178,7 @@ class TestReport(HandlerTestCase):
response = yield self.request('/report/%s/close' % report_id, "POST")
written_report_header['format'] = 'yaml'
- written_report_path = report_file_name(".", written_report_header)
+ written_report_path = report_file_name(".", written_report_header, report_id)
with open(written_report_path) as f:
self.filenames.add(written_report_path)
written_report = yaml.safe_load_all(f)
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits