lxcd list error fixed

This commit is contained in:
Andrew Hurley 2026-06-28 16:42:03 +08:00
parent f987c72c5f
commit 85b070b132
1 changed files with 1 additions and 1 deletions

View File

@ -108,7 +108,7 @@ def handle_list(args):
ipv4 = "N/A" ipv4 = "N/A"
state = c.get("state") state = c.get("state")
if state: if state:
networks = state.get("network", {}) networks = state.get("network") or {}
eth0 = networks.get("eth0", {}) eth0 = networks.get("eth0", {})
addrs = [a["address"] for a in eth0.get("addresses", []) addrs = [a["address"] for a in eth0.get("addresses", [])
if a.get("family") == "inet"] if a.get("family") == "inet"]