Verified Commit c73b5c48 authored by Štěpán Henek's avatar Štěpán Henek 🐻
Browse files

Argument --extra-modules-paths removed from foris-controller

* now modules should be registered via entrypoints
parent bcf6e868
......@@ -149,13 +149,6 @@ def controller_modules():
_override_exception("should return a list of required modules")
@pytest.fixture(scope="module")
def extra_module_paths():
""" List of extra modules paths, (--extra-modules-paths) argument
"""
return [] # by default return an empty list test should override this fixture
@pytest.fixture(scope="module")
def env_overrides():
""" List of env variables to be used with foris-controller (running within Infrastructure)
......@@ -176,7 +169,6 @@ def infrastructure(
backend,
message_bus,
controller_modules,
extra_module_paths,
cmdline_script_root,
env_overrides,
):
......@@ -192,7 +184,6 @@ def infrastructure(
instance = infrastructure_class(
backend,
controller_modules,
extra_module_paths,
UCI_CONFIG_DIR_PATH,
cmdline_script_root,
FILE_ROOT_PATH,
......@@ -341,7 +332,7 @@ def notify_cmd(infrastructure):
@pytest.fixture(scope="module")
def notify_api(extra_module_paths, infrastructure):
def notify_api(infrastructure):
if infrastructure.name == "ubus":
from foris_controller.buses.ubus import UbusNotificationSender
......@@ -362,7 +353,7 @@ def notify_api(extra_module_paths, infrastructure):
from foris_schema import ForisValidator
if validate:
validator = ForisValidator(*get_validator_dirs([module], extra_module_paths))
validator = ForisValidator(*get_validator_dirs([module]))
else:
validator = None
sender.notify(module, action, notification, validator)
......
......@@ -157,7 +157,6 @@ class Infrastructure(metaclass=abc.ABCMeta):
self,
backend_name,
modules,
extra_module_paths,
uci_config_dir,
cmdline_script_root,
file_root,
......@@ -187,15 +186,11 @@ class Infrastructure(metaclass=abc.ABCMeta):
self.make_listener()
modules = list(itertools.chain.from_iterable([("-m", e) for e in modules]))
extra_paths = list(
itertools.chain.from_iterable([("--extra-module-path", e) for e in extra_module_paths])
)
client_socket_option = ["-C", client_socket_path] if client_socket_path else []
args = (
["foris-controller"]
+ modules
+ extra_paths
+ client_socket_option
+ ["-d", "-b", backend_name, self.name]
)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment