Univention Bugzilla – Bug 56612
computerroom/computer/state: 'NoneType' object has no attribute 'powerOn'
Last modified: 2024-01-12 10:12:03 CET
5.0-4 errata771 - UCS@school 5.0 v4 Interner Server-Fehler in "computerroom/computer/state". Request: computerroom/computer/state Traceback (most recent call last): File "%PY3%/univention/management/console/base.py", line 387, in __error_handling six.reraise(etype, exc, etraceback) File "%PY3%/six.py", line 693, in reraise raise value File "%PY3%/univention/management/console/base.py", line 285, in execute function.__func__(self, request, *args, **kwargs) File "%PY3%/univention/management/console/modules/decorators.py", line 189, in _response return function(self, request) File "%PY3%/univention/management/console/modules/computerroom/__init__.py", line 208, in _decorated return func(self, *args, **kwargs) File "%PY3%/univention/management/console/modules/decorators.py", line 470, in _response result = _multi_response(self, request) File "%PY3%/univention/management/console/modules/decorators.py", line 189, in _response return function(self, request) File "%PY3%/univention/management/console/modules/decorators.py", line 594, in _response return list(function(self, iterator, *nones)) File "%PY3%/univention/management/console/modules/decorators.py", line 436, in _fake_func yield function(self, *args) File "%PY3%/univention/management/console/modules/computerroom/__init__.py", line 986, in computer_state computer.powerOn() AttributeError: 'NoneType' object has no attribute 'powerOn'
https://git.knut.univention.de/univention/ucsschool/-/blob/5.0/ucs-school-umc-computerroom/umc/python/computerroom/__init__.py#L267 return self.instance._computerroom.get(value) returns None if the computer wasn't found instead of raising a KeyError as the sanitizer expects. We should also add the computername to the error message, to make the message more helpful.
Same problem, but for powerOn 13.12.23 14:49:52.285 MAIN ( ERROR ) : Interner Server-Fehler in "computerroom/computer/state". Request: computerroom/computer/state Traceback (most recent call last): File "/usr/lib/python3/dist-packages/univention/management/console/base.py", line 387, in __error_handling six.reraise(etype, exc, etraceback) File "/usr/lib/python3/dist-packages/six.py", line 693, in reraise raise value File "/usr/lib/python3/dist-packages/univention/management/console/base.py", line 285, in execute function.__func__(self, request, *args, **kwargs) File "/usr/lib/python3/dist-packages/univention/management/console/modules/decorators.py", line 189, in _response return function(self, request) File "/usr/lib/python3/dist-packages/univention/management/console/modules/computerroom/__init__.py", line 208, in _decorated return func(self, request, *args, **kwargs) File "/usr/lib/python3/dist-packages/univention/management/console/modules/decorators.py", line 478, in _response result = _multi_response(self, request) File "/usr/lib/python3/dist-packages/univention/management/console/modules/decorators.py", line 189, in _response return function(self, request) File "/usr/lib/python3/dist-packages/univention/management/console/modules/decorators.py", line 602, in _response return list(function(self, iterator, *nones)) File "/usr/lib/python3/dist-packages/univention/management/console/modules/decorators.py", line 444, in _fake_func yield function(self, *args) File "/usr/lib/python3/dist-packages/univention/management/console/modules/computerroom/__init__.py", line 992, in computer_state computer.powerOff() AttributeError: 'NoneType' object has no attribute 'powerOff'
2024010221000151 5.0-6 errata906 - UCS@school 5.0 v4 Interner Server-Fehler in "computerroom/computer/state". Request: computerroom/computer/state Traceback (most recent call last): File "%PY3%/univention/management/console/base.py", line 387, in __error_handling six.reraise(etype, exc, etraceback) File "%PY3%/six.py", line 693, in reraise raise value File "%PY3%/univention/management/console/base.py", line 285, in execute function.__func__(self, request, *args, **kwargs) File "%PY3%/univention/management/console/modules/decorators.py", line 189, in _response return function(self, request) File "%PY3%/univention/management/console/modules/computerroom/__init__.py", line 208, in _decorated return func(self, request, *args, **kwargs) File "%PY3%/univention/management/console/modules/decorators.py", line 478, in _response result = _multi_response(self, request) File "%PY3%/univention/management/console/modules/decorators.py", line 189, in _response return function(self, request) File "%PY3%/univention/management/console/modules/decorators.py", line 602, in _response return list(function(self, iterator, *nones)) File "%PY3%/univention/management/console/modules/decorators.py", line 444, in _fake_func yield function(self, *args) File "%PY3%/univention/management/console/modules/computerroom/__init__.py", line 997, in computer_state computer.powerOn() AttributeError: 'NoneType' object has no attribute 'powerOn'