diff options
author | Vratko Polak <vrpolak@cisco.com> | 2019-07-10 16:45:31 +0200 |
---|---|---|
committer | Peter Mikus <pmikus@cisco.com> | 2019-07-10 15:02:40 +0000 |
commit | 82094363f6077e1b28845719db3a6191c0c93a99 (patch) | |
tree | 7ed74a8f6cd1701f6410c5c32b41dfaee7900484 | |
parent | c0b3bda5e9231601459a822bf0c0366c392c2f8b (diff) |
Tolerate failures when setting MTU
Because some NICs are known to not allow jumbo frames.
Change-Id: I45fe636e3a880c6640922468c170f50e85dd2ba2
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
-rw-r--r-- | resources/libraries/python/InterfaceUtil.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/resources/libraries/python/InterfaceUtil.py b/resources/libraries/python/InterfaceUtil.py index 22e7160dc9..7144e0adef 100644 --- a/resources/libraries/python/InterfaceUtil.py +++ b/resources/libraries/python/InterfaceUtil.py @@ -210,9 +210,14 @@ class InterfaceUtil(object): host=node['host']) args = dict(sw_if_index=sw_if_index, mtu=int(mtu)) - with PapiExecutor(node) as papi_exec: - papi_exec.add(cmd, **args).get_replies(err_msg).\ - verify_reply(err_msg=err_msg) + try: + with PapiExecutor(node) as papi_exec: + papi_exec.add(cmd, **args).get_replies(err_msg).\ + verify_reply(err_msg=err_msg) + except AssertionError as err: + # TODO: Make failure tolerance optional. + logger.debug("Setting MTU failed. Expected?\n{err}".format( + err=err)) @staticmethod def vpp_set_interfaces_mtu_on_node(node, mtu=9200): |