blob: a69ddd57f14b3f06fb2235810f5618d32a7015ef [file] [log] [blame]
Wei-Yu Chenad55cb82022-02-15 20:07:01 +08001# 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 Chen49950b92021-11-08 19:19:18 +08006import importlib
7import logging
8
9from configuration.exceptions import LoadConfigError
10from configuration.service_configs import load_service_config
11
12# Import all mconfig-providing modules so for the protobuf symbol database
13try:
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)
18except LoadConfigError:
19 logging.error('Could not load magmad yml config for mconfig modules')
20 importlib.import_module('orc8r.protos.mconfig.mconfigs_pb2')