From b867d83adb36a9cd517d47caf140e7612ea13f41 Mon Sep 17 00:00:00 2001 From: Marco Castelluccio Date: Thu, 3 Oct 2019 19:29:56 +0000 Subject: [PATCH] bug 1512499 - handle psutil returning None for physical_cores. r=froydnj psutil has a bug on arm systems where it will return None for physical_cores: https://github.com/giampaolo/psutil/issues/1359 This causes us to generate invalid telemetry data which raises an error. Fix this by simply omitting the field in this case. Differential Revision: https://phabricator.services.mozilla.com/D14969 UltraBlame original commit: be66f8877e465637de546fd3a94a55009e74f973 --- python/mozbuild/mozbuild/telemetry.py | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/python/mozbuild/mozbuild/telemetry.py b/python/mozbuild/mozbuild/telemetry.py index ac6506fdb542a..c4e65e01e686e 100644 --- a/python/mozbuild/mozbuild/telemetry.py +++ b/python/mozbuild/mozbuild/telemetry.py @@ -1492,12 +1492,7 @@ ( ) -info -[ -' physical_cores -' -] = psutil . @@ -1508,6 +1503,22 @@ False ) +if +physical_cores +is +not +None +: + +info +[ +' +physical_cores +' +] += +physical_cores + # total on