Hide Forgot
Description of problem: Using TestCaseRun.attach_bug verb I am getting an error: NameError: global name 'trc' is not defined I think there is a typo in testcaserun.py code (should be "tcr"). I am using the stage server at https://tcms-stage.englab.bne.redhat.com/xmlrpc/ Steps to Reproduce: 1. nitrate.do_command("TestCaseRun.attach_bug", [{"case_run_id": 475406, "bug_id": 690069, "bug_system_id": 1, "summary": "test", "description": "test"}]) Actual results: See additional info Expected results: Should attach the bug info to the TestCaseRun Additional info: <?xml version='1.0'?> <methodResponse> <fault> <value><struct> <member> <name>faultCode</name> <value><int>1</int></value> </member> <member> <name>faultString</name> <value><string>Traceback (most recent call last): File "/usr/lib/python2.4/site-packages/kobo/django/xmlrpc/dispatcher.py", line 94, in _marshaled_dispatch response = self._dispatch(method, params) File "/usr/lib64/python2.4/SimpleXMLRPCServer.py", line 406, in _dispatch return func(*params) File "/usr/lib/python2.4/site-packages/kobo/django/xmlrpc/decorators.py", line 91, in _new_function return function(request, *args, **kwargs) File "/usr/lib/python2.4/site-packages/kobo/django/xmlrpc/decorators.py", line 31, in _new_func return func(request, *args, **kwargs) File "/usr/lib/python2.4/site-packages/tcms/xmlrpc/testcaserun.py", line 147, in attach_bug trc.add_bug( NameError: global name 'trc' is not defined Frame attach_bug in /usr/lib/python2.4/site-packages/tcms/xmlrpc/testcaserun.py at line 147 <CODE> 140 try: 141 bug_system = TestCaseBugSystem.objects.get(id = value['bug_system_id']) 142 except: 143 raise 144 145 try: 146 tcr = TestCaseRun.objects.get(case_run_id = value['case_run_id']) --> 147 trc.add_bug( 148 bug_id = value['bug_id'], 149 bug_system = bug_system, 150 summary = value.get('summary'), 151 description = value.get('description') 152 ) 153 except:
*** Bug 691680 has been marked as a duplicate of this bug. ***
Raising the severity of this issue. IMO This feature is very basic / important for QA needs.
Will include the fix in 3.5, please wait for new version online. Sorry for inconvenience.
Verify 3.5.0-1 on stage -->PASS >>>from nitrate import NitrateKerbXmlrpc >>>handle=NitrateKerbXmlrpc('https://tcms-stage.englab.bne.redhat.com/xmlrpc/') >>>handle.server.TestCaseRun.attach_bug({'case_run_id':545636,'bug_id':123456,'bug_system_id': 1}) Actual result: Can add bug 123456 to testcase-run 545636.