Merge pull request #348 from coreemu/bugfix/existing-bridges

updates to cases when checking existing bridges using ip -j returns a…
This commit is contained in:
bharnden 2020-01-15 16:23:32 -08:00 committed by GitHub
commit 80c06f8216
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -268,7 +268,9 @@ class LinuxNetClient:
output = self.run(f"{IP_BIN} -j link show type bridge") output = self.run(f"{IP_BIN} -j link show type bridge")
bridges = json.loads(output) bridges = json.loads(output)
for bridge in bridges: for bridge in bridges:
name = bridge["ifname"] name = bridge.get("ifname")
if not name:
continue
fields = name.split(".") fields = name.split(".")
if len(fields) != 3: if len(fields) != 3:
continue continue