From 7ad737697453b633b3dcebec44ed9f97984d5bee Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 6 Dec 2019 08:30:53 -0600 Subject: [PATCH] mgr/devicehealth: import _strptime directly On some machines (in my case, ubuntu 18.04 with 2.7.15+), I see MGR_MODULE_ERROR Module 'devicehealth' has failed: Failed to import _strptime because the import lockis held by another thread. Module 'devicehealth' has failed: Failed to import _strptime because the import lockis held by another thread. This is apparently an issue with datetime on py2, see https://www.raspberrypi.org/forums/viewtopic.php?t=166912 Doing the import explicitly is a simple workaround (and resolves the warning in my test case). Signed-off-by: Sage Weil --- src/pybind/mgr/devicehealth/module.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pybind/mgr/devicehealth/module.py b/src/pybind/mgr/devicehealth/module.py index 092aa906388d4..54a51236d8f1e 100644 --- a/src/pybind/mgr/devicehealth/module.py +++ b/src/pybind/mgr/devicehealth/module.py @@ -9,6 +9,7 @@ import operator import rados from threading import Event from datetime import datetime, timedelta, date, time +import _strptime from six import iteritems TIME_FORMAT = '%Y%m%d-%H%M%S' -- 2.39.5