Improved FrameIO support and proxy messaging
Specific changes:
- FrameIO support for Mac OS X (making testing easier)
- Message passing between root and child devices implemented
(example use in simulated_olt and simulated_onu adapters
- Making FrameIOMgr accessible via registry so that modules
can easily reach it
- Making "main" to be a registered component so that command
line args and config file based info is accessible to all.
- Minor clean-ups and improvements
Change-Id: I6812dd5b198fef5cb19f17fc8d7948d3fba8b625
diff --git a/voltha/adapters/loader.py b/voltha/adapters/loader.py
index dca8afa..4a26dff 100644
--- a/voltha/adapters/loader.py
+++ b/voltha/adapters/loader.py
@@ -69,21 +69,24 @@
def _find_adapters(self):
subdirs = os.walk(mydir).next()[1]
- for subdir in subdirs:
- adapter_name = subdir
- py_file = os.path.join(mydir, subdir, subdir + '.py')
- if os.path.isfile(py_file):
- try:
- package_name = __package__ + '.' + subdir
- pkg = __import__(package_name, None, None, [adapter_name])
- module = getattr(pkg, adapter_name)
- except ImportError, e:
- log.exception('cannot-load', file=py_file, e=e)
- continue
+ try:
+ for subdir in subdirs:
+ adapter_name = subdir
+ py_file = os.path.join(mydir, subdir, subdir + '.py')
+ if os.path.isfile(py_file):
+ try:
+ package_name = __package__ + '.' + subdir
+ pkg = __import__(package_name, None, None, [adapter_name])
+ module = getattr(pkg, adapter_name)
+ except ImportError, e:
+ log.exception('cannot-load', file=py_file, e=e)
+ continue
- for attr_name in dir(module):
- cls = getattr(module, attr_name)
- if isinstance(cls, type) and \
- IAdapterInterface.implementedBy(cls):
- verifyClass(IAdapterInterface, cls)
- yield adapter_name, cls
+ for attr_name in dir(module):
+ cls = getattr(module, attr_name)
+ if isinstance(cls, type) and \
+ IAdapterInterface.implementedBy(cls):
+ verifyClass(IAdapterInterface, cls)
+ yield adapter_name, cls
+ except Exception, e:
+ log.exception('failed', e=e)