From c72f5ccd861c9b38c45eaa1ccb010117b7c1b366 Mon Sep 17 00:00:00 2001
From: Johan Wassberg <jocar@sunet.se>
Date: Fri, 12 Apr 2024 15:32:40 +0200
Subject: [PATCH] Allow for hosts without class(s)

---
 global/overlay/etc/puppet/cosmos_enc.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/global/overlay/etc/puppet/cosmos_enc.py b/global/overlay/etc/puppet/cosmos_enc.py
index dca12d3..7769a9a 100755
--- a/global/overlay/etc/puppet/cosmos_enc.py
+++ b/global/overlay/etc/puppet/cosmos_enc.py
@@ -26,7 +26,8 @@ found = False
 classes = dict()
 for reg, cls in rules.items():
     if re.search(reg, node_name):
-        classes.update(cls)
+        if cls:
+            classes.update(cls)
         found = True
 
 if not found: