Skip to content

Commit 7e5830e

Browse files
committed
addressed reviews
1 parent 705a61e commit 7e5830e

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

nodescraper/plugins/inband/amdsmi/amdsmi_collector.py

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
StaticXgmiPlpd,
6262
ValueUnit,
6363
)
64-
from nodescraper.utils import get_exception_details, get_exception_traceback
64+
from nodescraper.utils import get_exception_traceback
6565

6666

6767
class AmdSmiCollector(InBandDataCollector[AmdSmiDataModel, None]):
@@ -294,12 +294,12 @@ def _get_amdsmi_data(self) -> Optional[AmdSmiDataModel]:
294294
firmware=firmware,
295295
static=statics,
296296
)
297-
except ValidationError as e:
298-
self.logger.warning("Validation err: %s", e)
297+
except ValidationError as err:
298+
self.logger.warning("Validation err: %s", err)
299299
self._log_event(
300300
category=EventCategory.APPLICATION,
301301
description="Failed to build AmdSmiDataModel",
302-
data=get_exception_details(e),
302+
data={"errors": err.errors(include_url=False)},
303303
priority=EventPriority.ERROR,
304304
)
305305
return None
@@ -325,11 +325,11 @@ def _get_amdsmi_version(self) -> Optional[AmdSmiVersion]:
325325
amdsmi_library_version=version_data.get("amdsmi_library_version", ""),
326326
rocm_version=version_data.get("rocm_version", ""),
327327
)
328-
except ValidationError as e:
328+
except ValidationError as err:
329329
self._log_event(
330330
category=EventCategory.APPLICATION,
331331
description="Failed to build AmdSmiVersion",
332-
data=get_exception_details(e),
332+
data={"errors": err.errors(include_url=False)},
333333
priority=EventPriority.WARNING,
334334
)
335335
return None
@@ -368,11 +368,11 @@ def _to_int(x: Any, default: int = 0) -> int:
368368
partition_id=_to_int(item.get("partition_id", 0)),
369369
)
370370
)
371-
except ValidationError as e:
371+
except ValidationError as err:
372372
self._log_event(
373373
category=EventCategory.APPLICATION,
374374
description="Failed to build AmdSmiListItem",
375-
data={"exception": get_exception_traceback(e), "item": item},
375+
data={"errors": err.errors(include_url=False), "item": item},
376376
priority=EventPriority.WARNING,
377377
)
378378

@@ -441,12 +441,12 @@ def get_process(self) -> Optional[list[Processes]]:
441441
)
442442
)
443443
)
444-
except ValidationError as e:
444+
except ValidationError as err:
445445
self._log_event(
446446
category=EventCategory.APPLICATION,
447447
description="Failed to build ProcessListItem; skipping entry",
448448
data={
449-
"exception": get_exception_traceback(e),
449+
"errors": err.errors(include_url=False),
450450
"gpu_index": gpu_idx,
451451
"entry": repr(entry),
452452
},
@@ -456,11 +456,11 @@ def get_process(self) -> Optional[list[Processes]]:
456456

457457
try:
458458
out.append(Processes(gpu=gpu_idx, process_list=plist))
459-
except ValidationError as e:
459+
except ValidationError as err:
460460
self._log_event(
461461
category=EventCategory.APPLICATION,
462462
description="Failed to build Processes",
463-
data={"exception": get_exception_traceback(e), "gpu_index": gpu_idx},
463+
data={"errors": err.errors(include_url=False), "gpu_index": gpu_idx},
464464
priority=EventPriority.WARNING,
465465
)
466466

@@ -492,12 +492,12 @@ def get_partition(self) -> Optional[Partition]:
492492
memparts.append(
493493
PartitionMemory(gpu_id=gpu_idx, partition_type=str(mem_pt) if mem_pt else None)
494494
)
495-
except ValidationError as e:
495+
except ValidationError as err:
496496
self._log_event(
497497
category=EventCategory.APPLICATION,
498498
description="Failed to build PartitionMemory",
499499
data={
500-
"exception": get_exception_traceback(e),
500+
"errors": err.errors(include_url=False),
501501
"gpu_index": gpu_idx,
502502
"data": mem_pt,
503503
},
@@ -510,12 +510,12 @@ def get_partition(self) -> Optional[Partition]:
510510
gpu_id=gpu_idx, partition_type=str(comp_pt) if comp_pt else None
511511
)
512512
)
513-
except ValidationError as e:
513+
except ValidationError as err:
514514
self._log_event(
515515
category=EventCategory.APPLICATION,
516516
description="Failed to build PartitionCompute",
517517
data={
518-
"exception": get_exception_traceback(e),
518+
"errors": err.errors(include_url=False),
519519
"gpu_index": gpu_idx,
520520
"data": comp_pt,
521521
},
@@ -524,11 +524,11 @@ def get_partition(self) -> Optional[Partition]:
524524

525525
try:
526526
return Partition(memory_partition=memparts, compute_partition=computeparts)
527-
except ValidationError as e:
527+
except ValidationError as err:
528528
self._log_event(
529529
category=EventCategory.APPLICATION,
530530
description="Failed to build Partition",
531-
data={"exception": get_exception_traceback(e)},
531+
data={"errors": err.errors(include_url=False)},
532532
priority=EventPriority.WARNING,
533533
)
534534
return None
@@ -577,11 +577,11 @@ def get_firmware(self) -> Optional[list[Fw]]:
577577

578578
try:
579579
out.append(Fw(gpu=gpu_idx, fw_list=normalized))
580-
except ValidationError as e:
580+
except ValidationError as err:
581581
self._log_event(
582582
category=EventCategory.APPLICATION,
583583
description="Failed to build Fw",
584-
data={"exception": get_exception_traceback(e), "gpu_index": gpu_idx},
584+
data={"errors": err.errors(include_url=False), "gpu_index": gpu_idx},
585585
priority=EventPriority.WARNING,
586586
)
587587

@@ -757,12 +757,12 @@ def get_static(self) -> Optional[list[AmdSmiStatic]]:
757757
clock=clock_dict_model,
758758
)
759759
)
760-
except ValidationError as e:
761-
self.logger.error(e)
760+
except ValidationError as err:
761+
self.logger.error(err)
762762
self._log_event(
763763
category=EventCategory.APPLICATION,
764764
description="Failed to build AmdSmiStatic",
765-
data={"exception": get_exception_traceback(e), "gpu_index": gpu_idx},
765+
data={"errors": err.errors(include_url=False), "gpu_index": gpu_idx},
766766
priority=EventPriority.WARNING,
767767
)
768768

@@ -920,11 +920,11 @@ def _as_list_str(v: Any) -> list[str]:
920920
num_cache_instance=num_cache_instance,
921921
)
922922
)
923-
except ValidationError as ve:
923+
except ValidationError as err:
924924
self._log_event(
925925
category=EventCategory.APPLICATION,
926926
description="Bad cache info entry from amd-smi; skipping",
927-
data={"entry": repr(e), "exception": get_exception_traceback(ve)},
927+
data={"entry": repr(e), "errors": err.errors(include_url=False)},
928928
priority=EventPriority.WARNING,
929929
)
930930
continue

0 commit comments

Comments
 (0)