Skip to content

Commit

Permalink
Merge pull request #4029 from chloerh/gw-json
Browse files Browse the repository at this point in the history
utils_net:Fix func get_default_gateway_json
  • Loading branch information
Yingshun authored Nov 22, 2024
2 parents 8bfaead + 0b4ba16 commit 9323e4f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion virttest/utils_net.py
Original file line number Diff line number Diff line change
Expand Up @@ -4089,7 +4089,9 @@ def get_default_gateway_json(

default_route_list = [x for x in ip_route if x["dst"] == "default"]
if force_dhcp:
default_route_list = [x for x in default_route_list if x["protocol"] == "dhcp"]
default_route_list = [
x for x in default_route_list if x.get("protocol") == "dhcp"
]
if target_iface:
LOG.debug(f"Get default gateway only for: {target_iface}")
non_multi = [x for x in default_route_list if x.get("dev") == target_iface]
Expand Down

0 comments on commit 9323e4f

Please sign in to comment.