Skip to content

Commit 1da49e1

Browse files
committed
dmidecode (inv plugin): Move counter increments
Change-Id: I43661f7c693c917e01969723b98c7a8ce5b7c220
1 parent 944ff1c commit 1da49e1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cmk/plugins/collection/agent_based/inventory_dmidecode.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,8 @@ def inventory_dmidecode(section: Section) -> InventoryResult:
127127
case "Processor Information":
128128
yield from _make_inventory_processor(lines)
129129
case "Physical Memory Array":
130-
counter.update({"physical_memory_array": 1})
131130
yield _make_inventory_physical_mem_array(lines, counter)
132131
case "Memory Device":
133-
counter.update({"memory_device": 1})
134132
yield from _make_inventory_mem_device(lines, counter)
135133

136134

@@ -211,6 +209,7 @@ def _make_inventory_physical_mem_array(
211209
lines: list[list[str]],
212210
counter: Counter[Literal["physical_memory_array", "memory_device"]],
213211
) -> Attributes:
212+
counter.update({"physical_memory_array": 1})
214213
# We expect several possible arrays
215214
return Attributes(
216215
path=["hardware", "memory", "arrays", str(counter["physical_memory_array"])],
@@ -255,6 +254,7 @@ def _make_inventory_mem_device(
255254
device["speed"] = _parse_speed(device.get("speed", "Unknown")) # type: ignore[arg-type]
256255
device["size"] = _parse_size(device.get("size", "Unknown")) # type: ignore[arg-type]
257256

257+
counter.update({"memory_device": 1})
258258
key_columns = {k: device.pop(k) for k in ("set",)}
259259
key_columns.update({"index": counter["memory_device"]})
260260
yield TableRow(

0 commit comments

Comments
 (0)