From 277cf28b1c0f2dc0ee5e668fb1c0292cac6fbda3 2016-08-01 15:05:20 From: Marcin Lulek Date: 2016-08-01 15:05:20 Subject: [PATCH] validation: remove 0.4 report validators --- diff --git a/backend/src/appenlight/celery/tasks.py b/backend/src/appenlight/celery/tasks.py index 306eee9..79cd68a 100644 --- a/backend/src/appenlight/celery/tasks.py +++ b/backend/src/appenlight/celery/tasks.py @@ -99,40 +99,11 @@ def add_reports(resource_id, params, dataset, environ=None, **kwargs): es_report_docs = {} es_report_group_docs = {} resource = ApplicationService.by_id(resource_id) - reports = [] - - if proto_version.major < 1 and proto_version.minor < 5: - for report_data in dataset: - report_details = report_data.get('report_details', []) - for i, detail_data in enumerate(report_details): - report_data.update(detail_data) - report_data.pop('report_details') - traceback = report_data.get('traceback') - if traceback is None: - report_data['traceback'] = report_data.get('frameinfo') - # for 0.3 api - error = report_data.pop('error_type', '') - if error: - report_data['error'] = error - if proto_version.minor < 4: - # convert "Unknown" slow reports to - # '' (from older clients) - if (report_data['error'] and - report_data['http_status'] < 500): - report_data['error'] = '' - message = report_data.get('message') - if 'extra' not in report_data: - report_data['extra'] = [] - if message: - report_data['extra'] = [('message', message), ] - reports.append(report_data) - else: - reports = dataset tags = [] es_slow_calls_docs = {} es_reports_stats_rows = {} - for report_data in reports: + for report_data in dataset: # build report details for later added_details = 0 report = Report() diff --git a/backend/src/appenlight/validators.py b/backend/src/appenlight/validators.py index a56406e..636dc1a 100644 --- a/backend/src/appenlight/validators.py +++ b/backend/src/appenlight/validators.py @@ -360,25 +360,10 @@ class ReportSchemaBase(colander.MappingSchema): tags = TagSchemaList() -class ReportSchema_0_4(ReportSchemaBase): - error_type = colander.SchemaNode(colander.String(), - preparer=[shortener_factory(512)], - missing='') - report_details = ReportDetailListSchema() - - class ReportSchema_0_5(ReportSchemaBase, ReportDetailSchema_0_5): pass -class ReportListSchema_0_4(colander.SequenceSchema): - """ - Validates format of list of report groups - """ - report = ReportSchema_0_4() - validator = colander.Length(1) - - class ReportListSchema_0_5(colander.SequenceSchema): """ Validates format of list of report groups