Skip to content

Fix slurm.conf inventory filtering for nodenames with padding #143

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

Merged
merged 7 commits into from
Aug 9, 2022

Conversation

sjpb
Copy link
Collaborator

@sjpb sjpb commented Jul 28, 2022

The hostlist_expression filter is used to convert a list of hostnames from an inventory group into a nice short slurm hostlist expression IF those hosts have a numerical suffix. However currently it doesn't cope with padding, e.g. [compute-001, compute-002] gets converted into compute-[0-2] which breaks slurm (as those aren't actually the hostnames).

This PR fixes this and copes even with a pretty pathological case (see example in docstring below).

@sjpb sjpb requested a review from a team as a code owner August 3, 2022 12:02
@sjpb sjpb requested review from jovial and m-bull August 3, 2022 12:10
m-bull
m-bull previously approved these changes Aug 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants