From d1c95a468a9f1ad9ac04ad35c785c73630b74743 Mon Sep 17 00:00:00 2001 From: Blake Harnden <32446120+bharnden@users.noreply.github.com> Date: Wed, 15 Jan 2020 13:58:48 -0800 Subject: [PATCH] updates to log exceptions during threadpool, avoid errors when hwaddr is None during EMANE scenarios --- daemon/core/nodes/interface.py | 3 ++- daemon/core/utils.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/daemon/core/nodes/interface.py b/daemon/core/nodes/interface.py index 3a5836af..b583d3a8 100644 --- a/daemon/core/nodes/interface.py +++ b/daemon/core/nodes/interface.py @@ -153,7 +153,8 @@ class CoreInterface: :param str addr: hardware address to set to. :return: nothing """ - addr = utils.validate_mac(addr) + if addr is not None: + addr = utils.validate_mac(addr) self.hwaddr = addr def getparam(self, key: str) -> float: diff --git a/daemon/core/utils.py b/daemon/core/utils.py index 0d7e4a33..73e11cb8 100644 --- a/daemon/core/utils.py +++ b/daemon/core/utils.py @@ -440,6 +440,7 @@ def threadpool( result = future.result() results.append(result) except Exception as e: + logging.exception("thread pool exception") exceptions.append(e) return results, exceptions