Code review comment for lp:~stylesen/lava-scheduler/fix-worker-multinode-error

Revision history for this message
Neil Williams (codehelp) wrote :

A further fix is needed - it is possible for the new check to fail as there is no actual_device:

013-09-02 17:08:13,620 [ERROR] [lava_scheduler_daemon.service.JobQueue] AttributeError: 'NoneType' object has no attribute 'hostname'
Traceback (most recent call last):
  File "/srv/lava/.cache/eggs/Twisted-12.1.0-py2.7-linux-x86_64.egg/twisted/internet/base.py", line 1178, in mainLoop
    self.runUntilCurrent()
  File "/srv/lava/.cache/eggs/Twisted-12.1.0-py2.7-linux-x86_64.egg/twisted/internet/base.py", line 773, in runUntilCurrent
    f(*a, **kw)
  File "/srv/lava/.cache/eggs/Twisted-12.1.0-py2.7-linux-x86_64.egg/twisted/internet/defer.py", line 368, in callback
    self._startRunCallbacks(result)
  File "/srv/lava/.cache/eggs/Twisted-12.1.0-py2.7-linux-x86_64.egg/twisted/internet/defer.py", line 464, in _startRunCallbacks
    self._runCallbacks()
--- <exception caught here> ---
  File "/srv/lava/.cache/eggs/Twisted-12.1.0-py2.7-linux-x86_64.egg/twisted/internet/defer.py", line 551, in _runCallbacks
    current.result = callback(current.result, *args, **kw)
  File "/home/instance-manager/lava-scheduler/lava_scheduler_daemon/service.py", line 50, in _cbCheckJobs
    if job.actual_device.hostname in configured_boards:
exceptions.AttributeError: 'NoneType' object has no attribute 'hostname'

Testing:
if job.actual_device and job.actual_device.hostname in configured_boards:

« Back to merge proposal