]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/devicehealth: import _strptime directly 32082/head
authorSage Weil <sage@redhat.com>
Fri, 6 Dec 2019 14:30:53 +0000 (08:30 -0600)
committerSage Weil <sage@redhat.com>
Fri, 6 Dec 2019 14:30:53 +0000 (08:30 -0600)
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>
src/pybind/mgr/devicehealth/module.py

index 092aa906388d45587e06a115bcf375877823b234..54a51236d8f1e5bf1c339059557f61c1b0fb787a 100644 (file)
@@ -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'