Wei-Yu Chen | 49950b9 | 2021-11-08 19:19:18 +0800 | [diff] [blame] | 1 | import importlib |
| 2 | import logging |
| 3 | |
| 4 | from configuration.exceptions import LoadConfigError |
| 5 | from configuration.service_configs import load_service_config |
| 6 | |
| 7 | # Import all mconfig-providing modules so for the protobuf symbol database |
| 8 | try: |
| 9 | mconfig_modules = load_service_config('magmad').get('mconfig_modules', []) |
| 10 | for mod in mconfig_modules: |
| 11 | logging.info('Importing mconfig module %s', mod) |
| 12 | importlib.import_module(mod) |
| 13 | except LoadConfigError: |
| 14 | logging.error('Could not load magmad yml config for mconfig modules') |
| 15 | importlib.import_module('orc8r.protos.mconfig.mconfigs_pb2') |