From e19f1d0d1c6196357e0e7f1d57fb15cd83e9627a Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Thu, 22 Jun 2023 14:49:16 -0500 Subject: [PATCH] Changed 'type' to 'read_type' to avoid keyword class in UDP message --- Utilities/StorageFactory/src/StatisticsSenderService.cc | 2 +- Utilities/StorageFactory/test/test_file_statistics_sender.sh | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Utilities/StorageFactory/src/StatisticsSenderService.cc b/Utilities/StorageFactory/src/StatisticsSenderService.cc index aca9ed9c46473..b22c4c00e5f9c 100644 --- a/Utilities/StorageFactory/src/StatisticsSenderService.cc +++ b/Utilities/StorageFactory/src/StatisticsSenderService.cc @@ -392,7 +392,7 @@ void StatisticsSenderService::fillUDP(const std::string &siteName, } else { os << "\"fallback\": false, "; } - os << "\"type\": "; + os << "\"read_type\": "; switch (fileinfo.m_type) { case edm::InputType::Primary: { os << "\"primary\", "; diff --git a/Utilities/StorageFactory/test/test_file_statistics_sender.sh b/Utilities/StorageFactory/test/test_file_statistics_sender.sh index a9c16531db365..0ec1e0fb3d4fd 100755 --- a/Utilities/StorageFactory/test/test_file_statistics_sender.sh +++ b/Utilities/StorageFactory/test/test_file_statistics_sender.sh @@ -11,7 +11,10 @@ function testJSON { import json with open('test.json') as f: for line in f: - json.loads(line) + d = json.loads(line) + for k in d.keys(): + if k in ['producer', 'type', 'type_prefix', 'timestamp', 'host']: + raise RuntimeError("Found restricted keyword %s"%k) EOF RET=$? if [ "x$RET" != "x0" ]; then