Remove try block from privileged ip_lib module

It was marked that this try..except.. block can be removed when we will
be using pyroute2 >= 0.5.13. Now we have 0.5.13 in the lower-constraints
already so it's time to remove it.

Change-Id: Ic15361e34a2a9c371954d2f0851d230b8f9feb1f
This commit is contained in:
Slawek Kaplonski 2021-02-24 16:54:42 +01:00
parent 47eecd9b67
commit 8d44265736
1 changed files with 1 additions and 6 deletions

View File

@ -241,12 +241,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)