From 15aaf060933ba47c8120152e8e4efd8c7fa671a8 Mon Sep 17 00:00:00 2001 From: "StarsL.cn" Date: Mon, 9 Oct 2023 12:25:59 +0800 Subject: [PATCH] fix KeyError: 'EndTime' --- flask-consul/units/cloud/alicloud.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flask-consul/units/cloud/alicloud.py b/flask-consul/units/cloud/alicloud.py index 142b28c..04490cb 100644 --- a/flask-consul/units/cloud/alicloud.py +++ b/flask-consul/units/cloud/alicloud.py @@ -217,7 +217,7 @@ def redis(account,region): 'itype':i['ArchitectureType'], 'ver':i['EngineVersion'], 'mem':f"{i['Capacity']}MB", - 'exp': '-' if i['EndTime'] == None else i['EndTime'].split('T')[0] + 'exp': '-' if i.get('EndTime',None) == None else i.get('EndTime','-T').split('T')[0] } for i in redisbase_list} redis_dict.update(redis_dict_temp) if PageNumber == 1: