Merge "Remove try block from privileged ip_lib module"

This commit is contained in:
Zuul 2021-03-06 19:19:11 +00:00 committed by Gerrit Code Review
commit 2328cd7c84
1 changed files with 1 additions and 6 deletions

View File

@ -243,12 +243,7 @@ def _translate_ip_device_exception(e, device=None, namespace=None):
def get_link_id(device, namespace, raise_exception=True):
with get_iproute(namespace) as ip:
# TODO(ralonsoh): remove try block when the mininimum pyroute2 version
# is >= 0.5.13
try:
link_id = ip.link_lookup(ifname=device)
except NetlinkError:
link_id = None
link_id = ip.link_lookup(ifname=device)
if not link_id or len(link_id) < 1:
if raise_exception:
raise NetworkInterfaceNotFound(device=device, namespace=namespace)