Fix the 'full' mode which creates a complete config file

This commit is contained in:
Patrick Robertson
2025-02-20 11:29:36 +00:00
parent 4b51ec9ad5
commit 49b6c32058
3 changed files with 13 additions and 5 deletions

View File

@@ -22,8 +22,8 @@ DEFAULT_CONFIG_FILE = "orchestration.yaml"
EMPTY_CONFIG = _yaml.load("""
# Auto Archiver Configuration
# Steps are the modules that will be run in the order they are defined
# Steps are the modules that will be run in the order they are defined
steps:""" + "".join([f"\n {module}s: []" for module in MODULE_TYPES]) + \
"""

View File

@@ -134,7 +134,6 @@ class LazyBaseModule:
"""
name: str
type: list
description: str
path: str
module_factory: ModuleFactory
@@ -148,6 +147,10 @@ class LazyBaseModule:
self.path = path
self.module_factory = factory
@property
def type(self):
return self.manifest['type']
@property
def entry_point(self):
if not self._entry_point and not self.manifest['entry_point']:
@@ -186,7 +189,6 @@ class LazyBaseModule:
logger.error(f"Error loading manifest from file {self.path}/{MANIFEST_FILE}: {e}")
self._manifest = manifest
self.type = manifest['type']
self._entry_point = manifest['entry_point']
self.description = manifest['description']
self.version = manifest['version']

View File

@@ -125,7 +125,13 @@ class ArchivingOrchestrator:
yaml_config['steps'].setdefault(f"{module_type}s", []).append(module.name)
else:
# load all modules, they're not using the 'simple' mode
self.add_individual_module_args(self.module_factory.available_modules(), parser)
all_modules = self.module_factory.available_modules()
# add all the modules to the steps
for module in all_modules:
for module_type in module.type:
yaml_config['steps'].setdefault(f"{module_type}s", []).append(module.name)
self.add_individual_module_args(all_modules, parser)
parser.set_defaults(**to_dot_notation(yaml_config))
@@ -379,7 +385,7 @@ class ArchivingOrchestrator:
self.setup(args)
return self.feed()
except Exception as e:
logger.exception(e)
logger.error(e)
exit(1)
def cleanup(self) -> None: