Don't fail hard if the Linode API doesn't return a list of instances

This commit is contained in:
Fabio Manganiello 2022-04-25 14:02:13 +02:00
parent ca25607262
commit 12887b61fe

View file

@ -26,7 +26,7 @@ class LinodeBackend(SensorBackend):
self.instances = set(instances or []) self.instances = set(instances or [])
def process_data(self, data: Dict[str, dict], new_data: Optional[Dict[str, dict]] = None, **kwargs): def process_data(self, data: Dict[str, dict], new_data: Optional[Dict[str, dict]] = None, **kwargs):
instances = data['instances'] instances = data.get('instances', {})
old_instances = (self.data or {}).get('instances', {}) old_instances = (self.data or {}).get('instances', {})
if self.instances: if self.instances: