]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/devicehealth: parse new datetime
authorSage Weil <sage@redhat.com>
Tue, 30 Apr 2019 14:14:34 +0000 (09:14 -0500)
committerSage Weil <sage@redhat.com>
Wed, 29 May 2019 19:12:15 +0000 (14:12 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/pybind/mgr/devicehealth/module.py

index 2e14ca98a941429e6cad6ce3fe7f2caeed9855b7..46c748f24beb5618229350a9b3d51d801636b514 100644 (file)
@@ -478,11 +478,11 @@ class Module(MgrModule):
                dev['life_expectancy_max'] == '0.000000':
                 continue
             # life_expectancy_(min/max) is in the format of:
-            # '%Y-%m-%d %H:%M:%S.%f', e.g.:
-            # '2019-01-20 21:12:12.000000'
+            # '%Y-%m-%dT%H:%M:%S.%f%z', e.g.:
+            # '2019-01-20T21:12:12.000000Z'
             life_expectancy_max = datetime.strptime(
                 dev['life_expectancy_max'],
-                '%Y-%m-%d %H:%M:%S.%f')
+                '%Y-%m-%dT%H:%M:%S.%f%z')
             self.log.debug('device %s expectancy max %s', dev,
                            life_expectancy_max)