Skip to content

Commit 01aaf9a

Browse files
committed
Improve the detection logic of utils_net.get_dhcp_client
Remove host distro check, because there is no necessary correlation between the host version and the guest version Signed-off-by: Lei Yang <leiyang@redhat.com>
1 parent 37b7568 commit 01aaf9a

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

virttest/utils_net.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1717,11 +1717,7 @@ def get_dhcp_client(session):
17171717
:param session: serial session or remote session
17181718
:return: tuple of dhcp command and its release argument, raises TestError if none found
17191719
"""
1720-
dhcp_clients = [("dhclient", "-r"), ("dhcpcd", "-k")]
1721-
if distro.detect().name == "rhel" and int(distro.detect().version) >= 10:
1722-
dhcp_clients = [dhcp_clients[1]]
1723-
else:
1724-
dhcp_clients = [dhcp_clients[0]]
1720+
dhcp_clients = [("dhcpcd", "-k"), ("dhclient", "-r")]
17251721
for cmd, release_flag in dhcp_clients:
17261722
status, _ = utils_misc.cmd_status_output(
17271723
"which %s" % cmd, shell=True, ignore_status=True, session=session

0 commit comments

Comments
 (0)