From: Sage Weil Date: Fri, 6 Dec 2019 14:30:53 +0000 (-0600) Subject: mgr/devicehealth: import _strptime directly X-Git-Tag: v14.2.5~1^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F32082%2Fhead;p=ceph.git 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 --- diff --git a/src/pybind/mgr/devicehealth/module.py b/src/pybind/mgr/devicehealth/module.py index 092aa906388..54a51236d8f 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'