Merge "Remove try block from privileged ip_lib module"
This commit is contained in:
commit
2328cd7c84
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user