From eaa3567c9f1345e1439f38abf5fdc3746a970a57 Mon Sep 17 00:00:00 2001 From: Akihiro Motoki Date: Fri, 5 Aug 2016 07:38:49 +0900 Subject: [PATCH] zanata_stats: ensure to stringify user elements In Zanata, ID only with number is valid. If we put such entry in YAML file without quote, it is interpreted as integer when loading YAML file. This commit ensure to convert such entries to string when loading the translator YAML file. Change-Id: I14269bc06c736fa16b539cbc9090b58aa0e6079b --- tools/zanata/zanata_stats.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/zanata/zanata_stats.py b/tools/zanata/zanata_stats.py index db81ada..4075477 100755 --- a/tools/zanata/zanata_stats.py +++ b/tools/zanata/zanata_stats.py @@ -98,9 +98,12 @@ def _make_language_team(name, team_info): 'tag': 'language_team', 'language_code': name, 'language': team_info['language'], - 'translators': team_info['translators'], - 'reviewers': team_info.get('reviewers', []), - 'coordinators': team_info.get('coordinators', []), + # Zanata ID which only consists of numbers is a valid ID + # and such entry is interpreted as integer unless it is + # quoted in the YAML file. Ensure to stringify them. + 'translators': [str(i) for i in team_info['translators']], + 'reviewers': [str(i) for i in team_info.get('reviewers', [])], + 'coordinators': [str(i) for i in team_info.get('coordinators', [])], }