Skip to content
This repository has been archived by the owner on Aug 2, 2024. It is now read-only.

Account for mods with singular module_dirs, fix renderers, add fileserver #39

Merged
merged 2 commits into from
Nov 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 22 additions & 4 deletions src/saltext/cli/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"cloud",
"engines",
"executor",
"fileserver",
"grain",
"log_handlers",
"matchers",
Expand All @@ -46,7 +47,7 @@
"pillar",
"proxy",
"queue",
"render",
"renderer",
"returner",
"roster",
"runner",
Expand All @@ -64,6 +65,23 @@
"wrapper",
)

SINGULAR_MODULE_DIRS = (
"auth",
"cache",
"fileserver",
"metaproxy",
"netapi",
"output",
"pillar",
"pkgdb",
"proxy",
"roster",
"sdb",
"thorium",
"wheel",
"wrapper",
)


@click.command()
@click.version_option(version=__version__)
Expand Down Expand Up @@ -253,7 +271,7 @@ def main(
for loader_name in loader:
templating_context["loader"] = loader_name
loader_dir = None
if loader_name in ["sdb"]:
if loader_name in SINGULAR_MODULE_DIRS:
loader_dir = loaders_package_path / loader_name.rstrip("s")
else:
loader_dir = loaders_package_path / (loader_name.rstrip("s") + "s")
Expand All @@ -276,7 +294,7 @@ def main(
loader_dir_module.write_text(loader_module_contents.rstrip() + "\n")

loader_unit_tests_dir = None
if loader_name in ["sdb"]:
if loader_name in SINGULAR_MODULE_DIRS:
loader_unit_tests_dir = loaders_unit_tests_path / loader_name.rstrip("s")
else:
loader_unit_tests_dir = loaders_unit_tests_path / (loader_name.rstrip("s") + "s")
Expand All @@ -299,7 +317,7 @@ def main(
loader_unit_test_module.write_text(loader_unit_test_contents.rstrip() + "\n")

loader_integration_tests_dir = None
if loader_name in ["sdb"]:
if loader_name in SINGULAR_MODULE_DIRS:
loader_integration_tests_dir = loaders_integration_tests_path / loader_name.rstrip("s")
else:
loader_integration_tests_dir = loaders_integration_tests_path / (
Expand Down