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(slurmctld): fix node-configured action #50

Merged
merged 2 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 charms/slurmctld/src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ def _resume_nodes(self, nodelist: List[str]) -> None:
"""Run scontrol to resume the specified node list."""
nodes = ",".join(nodelist)
update_cmd = f"update nodename={nodes} state=resume"
self._slurmctld.scontrol(update_cmd)
self._slurmctld.scontrol(*shlex.split(update_cmd))
dsloanm marked this conversation as resolved.
Show resolved Hide resolved

@property
def _cluster_name(self) -> str:
Expand Down
9 changes: 9 additions & 0 deletions charms/slurmctld/tests/unit/test_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,3 +168,12 @@ def test_get_user_supplied_parameters(self, *_) -> None:
self.harness.charm._assemble_slurm_conf().job_acct_gather_frequency,
"task=30,network=40",
)

def test_resume_nodes_valid_input(self) -> None:
"""Test that the _resume_nodes method provides a valid scontrol command."""
self.harness.charm._slurmctld.scontrol = Mock()
self.harness.charm._resume_nodes(["juju-123456-1", "tester-node", "node-three"])
args, _ = self.harness.charm._slurmctld.scontrol.call_args
self.assertEqual(
args, ("update", "nodename=juju-123456-1,tester-node,node-three", "state=resume")
)