Skip to content

Commit

Permalink
Merge pull request #4036 from smitterl/stabilize_guest_iface
Browse files Browse the repository at this point in the history
utils_net: make function safe for serial session
  • Loading branch information
chloerh authored Dec 10, 2024
2 parents 2c4c8fe + ff8bdcf commit 3260765
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 @@ -3897,7 +3897,9 @@ def get_linux_iface_info(iface="", mac=None, session=None):
:return: dict-type info of interface, None if not get any
"""
ip_cmd = f"ip -json addr show {iface}"
run_func = session.cmd_output if session else process.getoutput
run_func = process.getoutput
if session:
run_func = lambda x: session.cmd_output(x, safe=True)

try:
ip_output_str = run_func(ip_cmd).strip()
Expand Down

0 comments on commit 3260765

Please sign in to comment.