Tolerate failures when setting MTU 55/20555/4
authorVratko Polak <vrpolak@cisco.com>
Wed, 10 Jul 2019 14:45:31 +0000 (16:45 +0200)
committerPeter Mikus <pmikus@cisco.com>
Wed, 10 Jul 2019 15:02:40 +0000 (15:02 +0000)
Because some NICs are known to not allow jumbo frames.

Change-Id: I45fe636e3a880c6640922468c170f50e85dd2ba2
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
resources/libraries/python/InterfaceUtil.py

index 22e7160..7144e0a 100644 (file)
@@ -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):

©2016 FD.io a Linux Foundation Collaborative Project. All Rights Reserved.
Linux Foundation is a registered trademark of The Linux Foundation. Linux is a registered trademark of Linus Torvalds.
Please see our privacy policy and terms of use.