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

[Bugfix] Fix a bug that was causing clustermgtd to fail when a field returned by the command scontrol show nodes has a value that contains the character =. #639

Merged
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
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ aws-parallelcluster-node CHANGELOG

This file is used to list changes made in each version of the aws-parallelcluster-node package.

3.11.0
------

**BUG FIXES**
- Fix a bug that was causing `clustermgtd` to fail when a field returned by the command `scontrol show nodes`
has a value that contains the character `=`.

3.10.1
------

Expand Down
2 changes: 1 addition & 1 deletion src/common/schedulers/slurm_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ def _parse_nodes_info(slurm_node_info: str) -> List[SlurmNode]:
lines = node.splitlines()
kwargs = {}
for line in lines:
key, value = line.split("=")
key, value = line.split("=", 1)
if key in date_fields:
if value not in ["None", "Unknown"]:
value = datetime.strptime(value, "%Y-%m-%dT%H:%M:%S").astimezone(tz=timezone.utc)
Expand Down
24 changes: 12 additions & 12 deletions tests/common/schedulers/test_slurm_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,23 +194,23 @@ def test_is_static_node(nodename, expected_is_static):
False,
),
(
"NodeName=multiple-dy-c5xlarge-4\n"
"NodeAddr=multiple-dy-c5xlarge-4\n"
"NodeHostName=multiple-dy-c5xlarge-4\n"
"NodeName=multiple-dy-c5xlarge-3\n"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you change the name from multiple-dy-c5xlarge-4 to multiple-dy-c5xlarge-3?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no reason, just fake unit test data

"NodeAddr=multiple-dy-c5xlarge-3\n"
"NodeHostName=multiple-dy-c5xlarge-3\n"
"State=IDLE+CLOUD+POWER\n"
"Partitions=multiple,multiple2\n"
"Reason=(Code:InsufficientInstanceCapacity)Failure when resuming nodes [root@2023-01-31T21:24:55]\n"
"SlurmdStartTime=2023-01-23T17:57:07\n"
"Partitions=multiple\n"
"Reason=some reason containing key=value entries \n"
"SlurmdStartTime=None\n"
"######\n",
[
DynamicNode(
"multiple-dy-c5xlarge-4",
"multiple-dy-c5xlarge-4",
"multiple-dy-c5xlarge-4",
"multiple-dy-c5xlarge-3",
"multiple-dy-c5xlarge-3",
"multiple-dy-c5xlarge-3",
"IDLE+CLOUD+POWER",
"multiple,multiple2",
"(Code:InsufficientInstanceCapacity)Failure when resuming nodes [root@2023-01-31T21:24:55]",
slurmdstarttime=datetime(2023, 1, 23, 17, 57, 7).astimezone(tz=timezone.utc),
"multiple",
"some reason containing key=value entries ",
slurmdstarttime=None,
),
],
False,
Expand Down
Loading