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 <sage@redhat.com>
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'