From 005adec437dc631d5b3f9f7b38cc640336bdc636 Mon Sep 17 00:00:00 2001 From: Markus Hilger Date: Fri, 9 Aug 2024 19:45:19 +0200 Subject: [PATCH] Add error handling for interface_names --- confluent_osdeploy/common/profile/scripts/confignet | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/confluent_osdeploy/common/profile/scripts/confignet b/confluent_osdeploy/common/profile/scripts/confignet index 20fcc8b8..562a8ca1 100644 --- a/confluent_osdeploy/common/profile/scripts/confignet +++ b/confluent_osdeploy/common/profile/scripts/confignet @@ -405,7 +405,10 @@ class NetworkManager(object): else: cname = stgs.get('connection_name', None) iname = list(cfg['interfaces'])[0] - ctype = self.devtypes[iname] + ctype = self.devtypes.get(iname, None) + if not ctype: + sys.stderr.write("Warning, no device found for interface_name ({0}), skipping setup\n".format(iname)) + return if stgs.get('vlan_id', None): vlan = stgs['vlan_id'] if ctype == 'infiniband':