Skip to content

Commit e8e7874

Browse files
committed
[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 `=`. Signed-off-by: Giacomo Marciani <mgiacomo@amazon.com>
1 parent d024a4d commit e8e7874

File tree

3 files changed

+20
-13
lines changed

3 files changed

+20
-13
lines changed

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ aws-parallelcluster-node CHANGELOG
33

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

6+
3.11.0
7+
------
8+
9+
**BUG FIXES**
10+
- Fix a bug that was causing `clustermgtd` to fail when a field returned by the command `scontrol show nodes`
11+
has a value that contains the character `=`.
12+
613
3.10.1
714
------
815

src/common/schedulers/slurm_commands.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ def _parse_nodes_info(slurm_node_info: str) -> List[SlurmNode]:
443443
lines = node.splitlines()
444444
kwargs = {}
445445
for line in lines:
446-
key, value = line.split("=")
446+
key, value = line.split("=", 1)
447447
if key in date_fields:
448448
if value not in ["None", "Unknown"]:
449449
value = datetime.strptime(value, "%Y-%m-%dT%H:%M:%S").astimezone(tz=timezone.utc)

tests/common/schedulers/test_slurm_commands.py

+12-12
Original file line numberDiff line numberDiff line change
@@ -194,23 +194,23 @@ def test_is_static_node(nodename, expected_is_static):
194194
False,
195195
),
196196
(
197-
"NodeName=multiple-dy-c5xlarge-4\n"
198-
"NodeAddr=multiple-dy-c5xlarge-4\n"
199-
"NodeHostName=multiple-dy-c5xlarge-4\n"
197+
"NodeName=multiple-dy-c5xlarge-3\n"
198+
"NodeAddr=multiple-dy-c5xlarge-3\n"
199+
"NodeHostName=multiple-dy-c5xlarge-3\n"
200200
"State=IDLE+CLOUD+POWER\n"
201-
"Partitions=multiple,multiple2\n"
202-
"Reason=(Code:InsufficientInstanceCapacity)Failure when resuming nodes [root@2023-01-31T21:24:55]\n"
203-
"SlurmdStartTime=2023-01-23T17:57:07\n"
201+
"Partitions=multiple\n"
202+
"Reason=some reason containing key=value entries \n"
203+
"SlurmdStartTime=None\n"
204204
"######\n",
205205
[
206206
DynamicNode(
207-
"multiple-dy-c5xlarge-4",
208-
"multiple-dy-c5xlarge-4",
209-
"multiple-dy-c5xlarge-4",
207+
"multiple-dy-c5xlarge-3",
208+
"multiple-dy-c5xlarge-3",
209+
"multiple-dy-c5xlarge-3",
210210
"IDLE+CLOUD+POWER",
211-
"multiple,multiple2",
212-
"(Code:InsufficientInstanceCapacity)Failure when resuming nodes [root@2023-01-31T21:24:55]",
213-
slurmdstarttime=datetime(2023, 1, 23, 17, 57, 7).astimezone(tz=timezone.utc),
211+
"multiple",
212+
"some reason containing key=value entries ",
213+
slurmdstarttime=None,
214214
),
215215
],
216216
False,

0 commit comments

Comments
 (0)