From 15a106c3b0a9a5b89be7db71b8e940840cce0ddb Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 20 Mar 2020 17:03:57 -0400 Subject: [PATCH] mgr/rook: tolerate timestamps that are None Signed-off-by: Sage Weil --- src/pybind/mgr/rook/rook_cluster.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pybind/mgr/rook/rook_cluster.py b/src/pybind/mgr/rook/rook_cluster.py index 5d0923e9d1045..2686c61e9df68 100644 --- a/src/pybind/mgr/rook/rook_cluster.py +++ b/src/pybind/mgr/rook/rook_cluster.py @@ -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) -- 2.39.5