]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/rook: tolerate timestamps that are None
authorSage Weil <sage@redhat.com>
Fri, 20 Mar 2020 21:03:57 +0000 (17:03 -0400)
committerSage Weil <sage@redhat.com>
Fri, 20 Mar 2020 21:03:57 +0000 (17:03 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/pybind/mgr/rook/rook_cluster.py

index 5d0923e9d1045675d2c812290ee411cad7565052..2686c61e9df68159038c6b4211b6cb179f5958eb 100644 (file)
@@ -338,10 +338,10 @@ class RookCluster(object):
             }
 
             # note: we want UTC but no tzinfo
-            if 'creation_timestamp' in d['metadata']:
+            if d['metadata'].get('creation_timestamp', None):
                 s['created'] = d['metadata']['creation_timestamp'].astimezone(
                     tz=datetime.timezone.utc).replace(tzinfo=None)
-            if 'start_time' in d['status']:
+            if d['status'].get('start_time', None):
                 s['started'] = d['status']['start_time'].astimezone(
                     tz=datetime.timezone.utc).replace(tzinfo=None)