Wei-Yu Chen | ad55cb8 | 2022-02-15 20:07:01 +0800 | [diff] [blame] | 1 | # SPDX-FileCopyrightText: 2020 The Magma Authors. |
| 2 | # SPDX-FileCopyrightText: 2022 Open Networking Foundation <support@opennetworking.org> |
| 3 | # |
| 4 | # SPDX-License-Identifier: BSD-3-Clause |
| 5 | |
Wei-Yu Chen | 49950b9 | 2021-11-08 19:19:18 +0800 | [diff] [blame] | 6 | import importlib |
| 7 | import logging |
| 8 | |
| 9 | from configuration.exceptions import LoadConfigError |
| 10 | from configuration.service_configs import load_service_config |
| 11 | |
| 12 | # Import all mconfig-providing modules so for the protobuf symbol database |
| 13 | try: |
| 14 | mconfig_modules = load_service_config('magmad').get('mconfig_modules', []) |
| 15 | for mod in mconfig_modules: |
| 16 | logging.info('Importing mconfig module %s', mod) |
| 17 | importlib.import_module(mod) |
| 18 | except LoadConfigError: |
| 19 | logging.error('Could not load magmad yml config for mconfig modules') |
| 20 | importlib.import_module('orc8r.protos.mconfig.mconfigs_pb2') |