Bug 1032653 - taskactions.task_info() fails with: 'NoneType' object has no attribute 'fqdn'
taskactions.task_info() fails with: 'NoneType' object has no attribute 'fqdn'
Status: CLOSED CURRENTRELEASE
Product: Beaker
Classification: Community
Component: general (Show other bugs)
0.14
Unspecified Unspecified
unspecified Severity unspecified (vote)
: 0.14.4
: ---
Assigned To: Dan Callaghan
tools-bugs
: Regression
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-20 09:26 EST by Jan Stancek
Modified: 2013-12-19 00:09 EST (History)
11 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-12-19 00:09:22 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jan Stancek 2013-11-20 09:26:02 EST
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 18:12:55 EST
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.