Skip to content

Commit dc4f90d

Browse files
authored
handle sockets with no cpu installed. should fix #117 (#118)
1 parent 5590f39 commit dc4f90d

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

netbox_agent/lshw.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,14 @@ def find_storage(self, obj):
103103
self.disks.append(d)
104104

105105
def find_cpus(self, obj):
106-
c = {}
107-
c["product"] = obj["product"]
108-
c["vendor"] = obj["vendor"]
109-
c["description"] = obj["description"]
110-
c["location"] = obj["slot"]
111-
112-
self.cpus.append(c)
106+
if "product" in obj:
107+
c = {}
108+
c["product"] = obj["product"]
109+
c["vendor"] = obj["vendor"]
110+
c["description"] = obj["description"]
111+
c["location"] = obj["slot"]
112+
113+
self.cpus.append(c)
113114

114115
def find_memories(self, obj):
115116
if "children" not in obj:

0 commit comments

Comments
 (0)