Bug 1032653 - taskactions.task_info() fails with: 'NoneType' object has no attribute 'fqdn'
Summary: taskactions.task_info() fails with: 'NoneType' object has no attribute 'fqdn'
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Beaker
Classification: Retired
Component: general
Version: 0.14
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: 0.14.4
Assignee: Dan Callaghan
QA Contact: tools-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-11-20 14:26 UTC by Jan Stancek
Modified: 2018-02-06 00:41 UTC (History)
10 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2013-12-19 05:09:22 UTC
Embargoed:


Attachments (Terms of Use)

Description Jan Stancek 2013-11-20 14:26:02 UTC
Description of problem:
If you try to get task info for task which has no resource allocated, it fails with exception:
  xmlrpclib.Fault: <Fault 1: "<type 'exceptions.AttributeError'>:'NoneType' object has no attribute 'fqdn'">

------
import xmlrpclib
s = xmlrpclib.ServerProxy('https://beaker/RPC2')
print s.taskactions.task_info('T:17370872')
------

And I get following in server logs:
------------------------------------
Nov 20 15:14:21 light beaker-server[27448]: bkr.server.xmlrpccontroller ERROR Error handling XML-RPC method
Nov 20 15:14:21 light beaker-server[27448]:  Traceback (most recent call last):
Nov 20 15:14:21 light beaker-server[27448]:    File "/usr/lib/python2.6/site-packages/bkr/server/xmlrpccontroller.py", line 54, in RPC2
Nov 20 15:14:21 light beaker-server[27448]:      response = self.process_rpc(method,params)
Nov 20 15:14:21 light beaker-server[27448]:    File "/usr/lib/python2.6/site-packages/bkr/server/xmlrpccontroller.py", line 43, in process_rpc
Nov 20 15:14:21 light beaker-server[27448]:      response = obj(*params)
Nov 20 15:14:21 light beaker-server[27448]:    File "/usr/lib/python2.6/site-packages/bkr/server/task_actions.py", line 50, in task_info
Nov 20 15:14:21 light beaker-server[27448]:      return TaskBase.get_by_t_id(taskid).task_info()
Nov 20 15:14:21 light beaker-server[27448]:    File "/usr/lib/python2.6/site-packages/bkr/server/model.py", line 6275, in task_info
Nov 20 15:14:21 light beaker-server[27448]:      worker          = dict(name = self.recipe.resource.fqdn),
Nov 20 15:14:21 light beaker-server[27448]:  AttributeError: 'NoneType' object has no attribute 'fqdn'

Version-Release number of selected component (if applicable):
0.14.3

How reproducible:
100%

Steps to Reproduce:
1. call taskactions.task_info() on task, where recipe aborted or was cancelled before any system/resource was assigned to it

Actual results:
xml/rpc failure

Expected results:
xml/rpc works and returns state info

Additional info:

Comment 2 Dan Callaghan 2013-11-21 23:12:55 UTC
This was a regression in 0.10 I think.

http://gerrit.beaker-project.org/2529


Note You need to log in before you can comment on or make changes to this bug.