[Bug]: slurm.conf editor doesn't correctly handle RebootProgram
option
#32
Labels
Status: Triage
Analysis of issue needs to completed before work can be undertaken.
Type: Bug
Issue reports a bug, or pull request fixes a bug.
Bug Description
The
parse_line
helper function fails to correctly parse theRebootProgram
option after a new slurm.conf file has been dumped by the editor. The issue is caused be the fact that the marshaller does not encapsulate the value ofRebootProgram
in quotations when dumping the new configuration to a file. The optionRebootProgram="/usr/sbin/reboot --reboot"
becomesRebootProgram=/usr/sbin/reboot --reboot
Then, if you attempt to re-edit the slurm.conf file,
parse_line
will split the option into two tokens: "RebootProgram=/usr/sbin/reboot" and--reboot
.parse_line
will then raise aValueError
because there's no=
character in--reboot
.slurmutils/slurmutils/models/model.py
Lines 96 to 98 in b124bab
The easiest fix is to just generalize
ReasonCallback
toQuoteCallback
and then setQuoteCallback
as the callback to use when parsing theRebootProgram
option.To Reproduce
Environment
Juju Ubuntu 22.04 LXD image, Python 3.10.12
Relevant log output
Additional context
Issue discovered as work on charmed-hpc/slurm-charms#35
The text was updated successfully, but these errors were encountered: