1
0
mirror of https://github.com/systemd/systemd.git synced 2025-05-27 21:05:55 +03:00

test-network: make link_exists() support alternative names

This commit is contained in:
Yu Watanabe 2022-10-31 12:12:26 +09:00
parent 2368ff812d
commit dee6c26f3e

View File

@ -411,7 +411,7 @@ def create_service_dropin(service, command, reload_command=None, additional_sett
create_unit_dropin(f'{service}.service', drop_in)
def link_exists(link):
return os.path.exists(os.path.join('/sys/class/net', link, 'ifindex'))
return call_quiet(f'ip link show {link}') == 0
def remove_link(*links, protect=False):
for link in links: