From 6071c3f7734d3b14d59f0271d7b355c863889164 Mon Sep 17 00:00:00 2001
From: Sam Roberts <sam.roberts@geant.org>
Date: Thu, 5 Dec 2024 15:14:30 +0000
Subject: [PATCH] POL1-869 urgent fix: treat non-recognized regions as if empty

---
 brian_dashboard_manager/inventory_provider/interfaces.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/brian_dashboard_manager/inventory_provider/interfaces.py b/brian_dashboard_manager/inventory_provider/interfaces.py
index 44951bc..ea0b023 100644
--- a/brian_dashboard_manager/inventory_provider/interfaces.py
+++ b/brian_dashboard_manager/inventory_provider/interfaces.py
@@ -436,4 +436,8 @@ def get_nren_regions(host):
         data = []
 
     jsonschema.validate(data, NREN_REGION_LIST_SCHEMA)
+    # ugly hack: if a region isn't on the list of recognised regions, prune it from the region list
+    # TODO: figure out something that isn't this
+    recognised_regions = ['EAP']
+    data = [d for d in data if d['region'] in recognised_regions]
     return data
-- 
GitLab