Skip to content

Commit

Permalink
Use old-style Salt entrypoints for improved backwards compatibility.
Browse files Browse the repository at this point in the history
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
  • Loading branch information
s0undt3ch committed Mar 20, 2022
1 parent ea38cee commit fba5174
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog/98.improvement.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use old-style Salt entrypoints for improved backwards compatibility.
3 changes: 2 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ pytest11=
salt-factories-log-server = saltfactories.plugins.log_server
salt-factories-loader-mock = saltfactories.plugins.loader
salt.loader =
salt-factories = saltfactories.utils.saltext
engines_dirs = saltfactories.utils.saltext:get_engines_dirs
log_handlers_dirs = saltfactories.utils.saltext:get_log_handlers_dirs

[bdist_wheel]
universal = false
Expand Down
17 changes: 17 additions & 0 deletions src/saltfactories/utils/saltext/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import pathlib

SALTEXT_DIR = pathlib.Path(__file__).resolve().parent


def get_engines_dirs():
"""
Return a list of directories for Salt to look for engine extensions.
"""
return [str(SALTEXT_DIR / "engines")]


def get_log_handlers_dirs():
"""
Return a list of directories for Salt to look for log handlers extensions.
"""
return [str(SALTEXT_DIR / "log_handlers")]
Empty file.

0 comments on commit fba5174

Please sign in to comment.