|
|
|
@ -9,12 +9,12 @@ def find_profile_by_name(config, profile_type):
|
|
|
|
|
return None
|
|
|
|
|
|
|
|
|
|
# --------------------------------------------------------------------------------------------------
|
|
|
|
|
def load_config(args, logger):
|
|
|
|
|
def load_config(args, logger, default_load_path: Path):
|
|
|
|
|
if args.config_file:
|
|
|
|
|
config_path = Path(args.config_file)
|
|
|
|
|
else:
|
|
|
|
|
# Look for `trash.yml` in the same directory as the main (entrypoint) python script.
|
|
|
|
|
config_path = Path(__name__).parent / 'trash.yml'
|
|
|
|
|
config_path = default_load_path / 'trash.yml'
|
|
|
|
|
|
|
|
|
|
logger.debug(f'Using configuration file: {config_path}')
|
|
|
|
|
|
|
|
|
@ -28,6 +28,8 @@ def load_config(args, logger):
|
|
|
|
|
# --------------------------------------------------------------------------------------------------
|
|
|
|
|
def load_config_string(args, logger, config_yaml):
|
|
|
|
|
config = yaml.load(config_yaml, Loader=yaml.Loader)
|
|
|
|
|
if not config:
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
server_name, type_name = args.type.split(':')
|
|
|
|
|
server_config = config[server_name]
|
|
|
|
@ -43,4 +45,4 @@ def load_config_string(args, logger, config_yaml):
|
|
|
|
|
if profile:
|
|
|
|
|
if args.tags is None:
|
|
|
|
|
args.tags = []
|
|
|
|
|
args.tags.extend(t for t in profile['tags'] if t not in args.tags)
|
|
|
|
|
args.tags.extend(t for t in profile['tags'] if t not in args.tags)
|
|
|
|
|