From bbc77b649c4f10afb06695b6c9779095e711d1c6 Mon Sep 17 00:00:00 2001 From: Pavlo Shchelokovskyy Date: Wed, 4 Sep 2024 13:50:38 +0300 Subject: [PATCH] Account for secret.created possibly being None current code will simply fail with NameError: name 'created' is not defined Change-Id: Idb907edf84900c517f538d2bfc9f334244368067 --- castellan/key_manager/barbican_key_manager.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/castellan/key_manager/barbican_key_manager.py b/castellan/key_manager/barbican_key_manager.py index 79bd5a12..4eaccff6 100644 --- a/castellan/key_manager/barbican_key_manager.py +++ b/castellan/key_manager/barbican_key_manager.py @@ -547,6 +547,8 @@ class BarbicanKeyManager(key_manager.KeyManager): time_stamp = timeutils.parse_isotime( str(secret.created)).timetuple() created = calendar.timegm(time_stamp) + else: + created = None if issubclass(secret_type, key_base_class.Key): return secret_type(algorithm=secret.algorithm,