26 lines
1.0 KiB
Diff
26 lines
1.0 KiB
Diff
From 4cb49adb623f36590f254b7e11c8aa5b0777bd00 Mon Sep 17 00:00:00 2001
|
|
From: gaoruoshu <gaoruoshu@huawei.com>
|
|
Date: Tue, 26 Apr 2022 02:01:27 +0000
|
|
Subject: [PATCH 03/11] fix bug: list index out of range in virtualbox
|
|
|
|
---
|
|
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:
|
|
--
|
|
2.27.0
|
|
|