From 56627c1aa997d6bcdcf15794d122111afbe0e405 Mon Sep 17 00:00:00 2001 From: Mathis Ribet Date: Sat, 12 Oct 2024 15:48:40 +0200 Subject: [PATCH] Fix disk size --- netbox_agent/inventory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netbox_agent/inventory.py b/netbox_agent/inventory.py index 40e73d4..a88b35e 100644 --- a/netbox_agent/inventory.py +++ b/netbox_agent/inventory.py @@ -341,7 +341,7 @@ class Inventory(): for disk in self.lshw.get_hw_linux("storage"): if self.is_virtual_disk(disk, raid_devices): continue - size = int(getattr(disk, "size", 0)) / 1073741824 + size = round(int(disk.get("size", 0)) / 1073741824, 1) d = { "name": "", 'Size': '{} GB'.format(size),