From 781dc806a8ea8cc35b88a0a2dca5ee63b1fbfbd9 Mon Sep 17 00:00:00 2001 From: Blake Harnden <32446120+bharnden@users.noreply.github.com> Date: Wed, 15 Jan 2020 16:20:35 -0800 Subject: [PATCH] updates to cases when checking existing bridges using ip -j returns an empty object --- daemon/core/nodes/netclient.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/daemon/core/nodes/netclient.py b/daemon/core/nodes/netclient.py index 1236468f..c5de1c8e 100644 --- a/daemon/core/nodes/netclient.py +++ b/daemon/core/nodes/netclient.py @@ -268,7 +268,9 @@ class LinuxNetClient: output = self.run(f"{IP_BIN} -j link show type bridge") bridges = json.loads(output) for bridge in bridges: - name = bridge["ifname"] + name = bridge.get("ifname") + if not name: + continue fields = name.split(".") if len(fields) != 3: continue