A-Tune-Collector/fix-bug-list-index-out-of-range-in-virtualbox.patch

26 lines
1.0 KiB
Diff
Raw Normal View History

2023-03-09 14:54:39 +08:00
From 4cb49adb623f36590f254b7e11c8aa5b0777bd00 Mon Sep 17 00:00:00 2001
From: gaoruoshu <gaoruoshu@huawei.com>
Date: Tue, 26 Apr 2022 02:01:27 +0000
2023-08-01 09:43:39 +08:00
Subject: [PATCH 03/11] fix bug: list index out of range in virtualbox
2023-03-09 14:54:39 +08:00
---
atune_collector/plugin/monitor/memory/bandwidth.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/atune_collector/plugin/monitor/memory/bandwidth.py b/atune_collector/plugin/monitor/memory/bandwidth.py
index 593a4a8..f44925f 100755
--- a/atune_collector/plugin/monitor/memory/bandwidth.py
+++ b/atune_collector/plugin/monitor/memory/bandwidth.py
@@ -153,7 +153,7 @@ class MemBandwidth(Monitor):
info = json.loads(info_json)
dimms = [[0 for i in range(8)] for i in range(8)]
- if "children" not in info["memorys"][0]:
+ if info["memorys"] is None or len(info["memorys"]) == 0 or "children" not in info["memorys"][0]:
return 0
for dimm in info["memorys"][0]["children"]:
if dimm.get("size") is None:
--
2023-08-01 09:43:39 +08:00
2.27.0
2023-03-09 14:54:39 +08:00