ffggrz/ext-respondd

KeyError: 'Processor' for /proc/cpuinfo

Closed this issue · 0 comments

On my Raspberry the ext-respondd currently aborts after startup and reports:

Apr 15 18:25:36 ffplieningrpb4olv6a systemd[1]: Started ext-respondd (respondd status for servers).
Apr 15 18:26:30 ffplieningrpb4olv6a ext-respondd.py[1517]: Traceback (most recent call last):
Apr 15 18:26:30 ffplieningrpb4olv6a ext-respondd.py[1517]:   File "/opt/ext-respondd/ext-respondd.py", line 48, in <module>
Apr 15 18:26:30 ffplieningrpb4olv6a ext-respondd.py[1517]:     extResponddClient.start()
Apr 15 18:26:30 ffplieningrpb4olv6a ext-respondd.py[1517]:   File "/opt/ext-respondd/lib/respondd_client.py", line 60, in start
Apr 15 18:26:30 ffplieningrpb4olv6a ext-respondd.py[1517]:     responseStruct[request] = self.buildStruct(request)
Apr 15 18:26:30 ffplieningrpb4olv6a ext-respondd.py[1517]:   File "/opt/ext-respondd/lib/respondd_client.py", line 82, in buildStruct
Apr 15 18:26:30 ffplieningrpb4olv6a ext-respondd.py[1517]:     return responseClass.getStruct()
Apr 15 18:26:30 ffplieningrpb4olv6a ext-respondd.py[1517]:   File "/opt/ext-respondd/lib/respondd.py", line 31, in getStruct
Apr 15 18:26:30 ffplieningrpb4olv6a ext-respondd.py[1517]:     ret = self._get()
Apr 15 18:26:30 ffplieningrpb4olv6a ext-respondd.py[1517]:   File "/opt/ext-respondd/lib/nodeinfo.py", line 115, in _get
Apr 15 18:26:30 ffplieningrpb4olv6a ext-respondd.py[1517]:     'model': self.getCPUInfo()['model name'],
Apr 15 18:26:30 ffplieningrpb4olv6a ext-respondd.py[1517]:   File "/opt/ext-respondd/lib/nodeinfo.py", line 74, in getCPUInfo
Apr 15 18:26:30 ffplieningrpb4olv6a ext-respondd.py[1517]:     ret["model name"] = ret["Processor"]
Apr 15 18:26:30 ffplieningrpb4olv6a ext-respondd.py[1517]: KeyError: 'Processor'
Apr 15 18:26:30 ffplieningrpb4olv6a systemd[1]: ext-respondd.service: Main process exited, code=exited, status=1/FAILURE
Apr 15 18:26:30 ffplieningrpb4olv6a systemd[1]: ext-respondd.service: Failed with result 'exit-code'.

The syslog said something about KeyError: 'Processor' well in the /proc/cpuinfo it is also written in small letters: processor, so I made a small adjustment in the /opt/ext-respondd/lib/nodeinfo.py:

    if 'model name' not in ret:
      ret["model name"] = ret["processor"]

and the ext-respondd runs again.

Originally posted by @Django-BOfH in #9 (comment)