VOL-217 - Add check in adapter loader to skip over IAdapter class
In _find_adapters(), getattr() returns the IAdapter as an attribute
which the loader tries to load as well (and fails). Adding a
check to skip if attribute is IAdapter.
Change-Id: If6ad0e93f9919905eef304e767c8fc8ac967d4d6
Signed-off-by: Shad Ansari <shad@onlab.us>
diff --git a/voltha/adapters/loader.py b/voltha/adapters/loader.py
index 374b495..cbc07e7 100644
--- a/voltha/adapters/loader.py
+++ b/voltha/adapters/loader.py
@@ -32,6 +32,7 @@
from voltha.core.adapter_agent import AdapterAgent
from voltha.protos import third_party
from voltha.registry import IComponent
+from voltha.adapters.iadapter import IAdapter
log = structlog.get_logger()
@@ -85,6 +86,7 @@
for attr_name in dir(module):
cls = getattr(module, attr_name)
if isinstance(cls, type) and \
+ cls is not IAdapter and \
IAdapterInterface.implementedBy(cls):
verifyClass(IAdapterInterface, cls)
yield adapter_name, cls