Change plugin runner to use a base_config_path.

This commit is contained in:
Mike Auty
2018-09-24 00:45:36 +01:00
parent e5024420c8
commit 99ba8bfb3f
3 changed files with 10 additions and 6 deletions
+4 -2
View File
@@ -9,7 +9,7 @@ vollog = logging.getLogger(__name__)
def run_plugin(context: interfaces.context.ContextInterface,
automagics: typing.List[interfaces.automagic.AutomagicInterface],
plugin: typing.Type[interfaces.plugins.PluginInterface],
plugin_config_path: str,
base_config_path: str,
progress_callback: interfaces.layers.ProgressValue,
file_consumer: interfaces.plugins.FileConsumerInterface) -> interfaces.plugins.PluginInterface:
"""Constructs a plugin object based on the parameters
@@ -27,7 +27,9 @@ def run_plugin(context: interfaces.context.ContextInterface,
Returns:
The constructed plugin object
"""
errors = automagic.run(automagics, context, plugin, "plugins", progress_callback = progress_callback)
errors = automagic.run(automagics, context, plugin, base_config_path, progress_callback = progress_callback)
# Plugins always get their configuration stored under their plugin name
plugin_config_path = interfaces.configuration.path_join(base_config_path, plugin.__name__)
# Check all the requirements and/or go back to the automagic step
unsatisfied = plugin.unsatisfied(context, plugin_config_path)