Skip to content

Commit

Permalink
[Bugfix] Fix a bug that was causing clustermgtd to fail when
Browse files Browse the repository at this point in the history
a field returned by the command `scontrol show nodes`
has a value that contains the character `=`.

Signed-off-by: Giacomo Marciani <[email protected]>
  • Loading branch information
gmarciani committed Jul 10, 2024
1 parent d024a4d commit e8e7874
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 13 deletions.
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"
"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

0 comments on commit e8e7874

Please sign in to comment.