From a602463dce7cf2be900df520a2b17f188c158cbd Mon Sep 17 00:00:00 2001 From: Daniel McKnight Date: Wed, 28 Aug 2024 17:47:52 -0700 Subject: [PATCH] Update warning log to use log_deprecation Update config handling to support `api_services` config outside of `keys` since #98 enabled more configuration options --- neon_api_proxy/controller.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/neon_api_proxy/controller.py b/neon_api_proxy/controller.py index 9e6414a..13d6757 100644 --- a/neon_api_proxy/controller.py +++ b/neon_api_proxy/controller.py @@ -27,7 +27,7 @@ # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. from os.path import join, isfile -from ovos_utils.log import LOG +from ovos_utils.log import LOG, log_deprecation from ovos_config.config import Configuration from neon_utils.configuration_utils import NGIConfig from ovos_config.locations import get_xdg_config_save_path @@ -70,10 +70,14 @@ def _init_config() -> dict: legacy_config_file = join(get_xdg_config_save_path(), "ngi_auth_vars.yml") if isfile(legacy_config_file): - LOG.warning(f"Legacy configuration found at: {legacy_config_file}") + log_deprecation(f"Legacy configuration found at: {legacy_config_file}. " + f"This will be ignored in future versions.", + "1.0.0") return NGIConfig("ngi_auth_vars").get("api_services") or dict() else: - return Configuration().get("keys", {}).get("api_services") or dict() + config = Configuration() + return config.get("keys", {}).get("api_services") or \ + config.get("api_services") or dict() def init_service_instances(self, service_class_mapping: dict) -> dict: """