Skip to content

Commit

Permalink
Use salt's entry-points instead of relying on loader *_dirs configs
Browse files Browse the repository at this point in the history
Fixes #98

Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
  • Loading branch information
s0undt3ch committed Feb 14, 2022
1 parent 62ad370 commit 52050f6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
1 change: 1 addition & 0 deletions changelog/98.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use salt's entry-points instead of relying on loader ``*_dirs`` configs
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ pytest11=
salt-factories-event-listener = saltfactories.plugins.event_listener
salt-factories-log-server = saltfactories.plugins.log_server
salt-factories-loader-mock = saltfactories.plugins.loader
salt.loader =
salt-factories = saltfactories.utils.saltext

[bdist_wheel]
universal = false
10 changes: 0 additions & 10 deletions src/saltfactories/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,20 +145,10 @@ def final_common_config_tweaks(self, config, role):
if "pytest" not in config["engines"]:
config["engines"].append("pytest")

if "engines_dirs" not in config:
config["engines_dirs"] = []
config["engines_dirs"].insert(0, str(FactoriesManager.get_salt_engines_path()))
config.setdefault("user", running_username())
if not config["user"]: # pragma: no cover
# If this value is empty, None, False, just remove it
config.pop("user")
if "log_forwarding_consumer" not in config:
# Still using old logging, let's add our custom log handler
if "log_handlers_dirs" not in config:
config["log_handlers_dirs"] = []
config["log_handlers_dirs"].insert(
0, str(FactoriesManager.get_salt_log_handlers_path())
)

pytest_key = "pytest-{}".format(role)
if pytest_key not in config:
Expand Down

0 comments on commit 52050f6

Please sign in to comment.