Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: correctly marshall slurm dict boolean values #28

Merged
merged 3 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "slurmutils"
version = "0.8.0"
version = "0.8.1"
description = "Utilities and APIs for interfacing with the Slurm workload manager."
repository = "https://github.com/charmed-hpc/slurmutils"
authors = ["Jason C. Nucciarone <[email protected]>"]
Expand Down
2 changes: 1 addition & 1 deletion slurmutils/models/callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def to_slurm_dict(value: Dict[str, Any]) -> str:
result = []
for k, v in value.items():
if isinstance(v, bool) and v:
result.append(v)
result.append(k)
continue

result.append(f"{k}={v}")
Expand Down
2 changes: 2 additions & 0 deletions tests/unit/editors/test_slurmconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ def test_edit(self) -> None:
config.max_job_count = 20000
config.proctrack_type = "proctrack/linuxproc"
config.plugin_dir.append("/snap/slurm/current/plugins")
config.slurmctld_parameters = {"enable_configless": True}
new_node = Node(NodeName="batch-0", **config.nodes["juju-c9fc6f-2"])
del config.nodes["juju-c9fc6f-2"]
config.nodes.update(new_node.dict())
Expand All @@ -92,6 +93,7 @@ def test_edit(self) -> None:
config.plugin_dir,
["/usr/local/lib", "/usr/local/slurm/lib", "/snap/slurm/current/plugins"],
)
self.assertDictEqual(config.slurmctld_parameters, {"enable_configless": True})
self.assertEqual(config.nodes["batch-0"]["NodeAddr"], "10.152.28.48")

with slurmconfig.edit("/etc/slurm/slurm.conf") as config:
Expand Down