From cd2509c4853502482bf1eea2269ba9c38385fd7f Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 13 Dec 2024 16:16:12 -0500 Subject: [PATCH] Ignore unparseable net config files If some pre-processing has rendered config files unparseable, ignore the file as we can't intelligently rewrite those. --- confluent_osdeploy/common/profile/scripts/confignet | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/confluent_osdeploy/common/profile/scripts/confignet b/confluent_osdeploy/common/profile/scripts/confignet index 6021c8d4..71c156a7 100644 --- a/confluent_osdeploy/common/profile/scripts/confignet +++ b/confluent_osdeploy/common/profile/scripts/confignet @@ -226,7 +226,11 @@ class WickedManager(object): self.cfgbydev[devname] = currcfg for cfg in open(ifcfg).read().splitlines(): cfg = cfg.split('#', 1)[0] - kv = ' '.join(shlex.split(cfg)).split('=', 1) + try: + kv = ' '.join(shlex.split(cfg)).split('=', 1) + except Exception: + # unparseable line, likely having something we can't handle + del self.cfgbydev[devname] if len(kv) != 2: continue k, v = kv