Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions virttest/utils_net.py
Original file line number Diff line number Diff line change
Expand Up @@ -1717,11 +1717,7 @@ def get_dhcp_client(session):
:param session: serial session or remote session
:return: tuple of dhcp command and its release argument, raises TestError if none found
"""
dhcp_clients = [("dhclient", "-r"), ("dhcpcd", "-k")]
if distro.detect().name == "rhel" and int(distro.detect().version) >= 10:
dhcp_clients = [dhcp_clients[1]]
else:
dhcp_clients = [dhcp_clients[0]]
dhcp_clients = [("dhcpcd", "-k"), ("dhclient", "-r")]
for cmd, release_flag in dhcp_clients:
status, _ = utils_misc.cmd_status_output(
"which %s" % cmd, shell=True, ignore_status=True, session=session
Expand Down
Loading