From 458ce4335484ef3214f841e562c2a294f88e7a8d Mon Sep 17 00:00:00 2001 From: Shaanjot Gill Date: Fri, 31 Mar 2023 12:52:03 -0700 Subject: [PATCH] upgrade config path fix Signed-off-by: Shaanjot Gill --- aries_cloudagent/commands/upgrade.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/aries_cloudagent/commands/upgrade.py b/aries_cloudagent/commands/upgrade.py index be98d043ab..87082d65f5 100644 --- a/aries_cloudagent/commands/upgrade.py +++ b/aries_cloudagent/commands/upgrade.py @@ -2,6 +2,7 @@ import asyncio import logging +import os import yaml from configargparse import ArgumentParser @@ -23,9 +24,7 @@ from . import PROG -DEFAULT_UPGRADE_CONFIG_PATH = ( - "./aries_cloudagent/commands/default_version_upgrade_config.yml" -) +DEFAULT_UPGRADE_CONFIG_FILE_NAME = "default_version_upgrade_config.yml" LOGGER = logging.getLogger(__name__) @@ -43,7 +42,12 @@ def __init__(self, config_path: str = None): if config_path: self.setup_version_upgrade_config(config_path) else: - self.setup_version_upgrade_config(DEFAULT_UPGRADE_CONFIG_PATH) + self.setup_version_upgrade_config( + os.path.join( + os.path.dirname(os.path.realpath(__file__)), + DEFAULT_UPGRADE_CONFIG_FILE_NAME, + ) + ) def setup_version_upgrade_config(self, path: str): """Set ups config dict from the provided YML file."""