Bug 1171671
| Summary: | catching wrong exception if testcase has no caseplan | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Ales Zelinka <azelinka> | ||||
| Component: | python-nitrate | Assignee: | Petr Šplíchal <psplicha> | ||||
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||
| Severity: | medium | Docs Contact: | |||||
| Priority: | medium | ||||||
| Version: | 22 | CC: | isenfeld, ohudlick, psplicha | ||||
| Target Milestone: | --- | Keywords: | Patch | ||||
| Target Release: | --- | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | python-nitrate-1.3-1.el7 | Doc Type: | Bug Fix | ||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2016-02-22 07:56:29 UTC | Type: | Bug | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Embargoed: | |||||||
| Attachments: |
|
||||||
This bug appears to have been reported against 'rawhide' during the Fedora 22 development cycle. Changing version to '22'. More information and reason for this action is here: https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora22 Created attachment 1121087 [details]
proposed patch
Exception changed from KeyError to LookupError.
Thanks for the patch, Iveta. Merged into master: https://github.com/psss/python-nitrate/commit/e902887 python-nitrate-1.3-1.el6 has been submitted as an update to Fedora EPEL 6. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-687d19409b python-nitrate-1.3-1.el7 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-35a106d076 python-nitrate-1.3-1.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2016-2bb9364c32 python-nitrate-1.3-1.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-7474e957a9 Latest packages for testing available in the copr repository: https://copr.fedorainfracloud.org/coprs/psss/python-nitrate/ python-nitrate-1.3-1.el6 has been pushed to the Fedora EPEL 6 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-687d19409b python-nitrate-1.3-1.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-2bb9364c32 python-nitrate-1.3-1.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-7474e957a9 python-nitrate-1.3-1.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2016-35a106d076 python-nitrate-1.3-1.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report. python-nitrate-1.3-1.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report. python-nitrate-1.3-1.el6 has been pushed to the Fedora EPEL 6 stable repository. If problems still persist, please make note of it in this bug report. python-nitrate-1.3-1.el7 has been pushed to the Fedora EPEL 7 stable repository. If problems still persist, please make note of it in this bug report. |
Description of problem: Traceback (most recent call last): File "/usr/bin/tcms-plan", line 427, in <module> errata, general_plan) File "/usr/bin/tcms-plan", line 281, in create_update_plan testcases = set([case for case in general_plan File "/usr/lib/python2.6/site-packages/nitrate/mutable.py", line 184, in __iter__ for testcase in self.testcases: File "/usr/lib/python2.6/site-packages/nitrate/containers.py", line 779, in __iter__ self._items, key=lambda x: self._object.sortkey(x)): File "/usr/lib/python2.6/site-packages/nitrate/containers.py", line 779, in <lambda> self._items, key=lambda x: self._object.sortkey(x)): File "/usr/lib/python2.6/site-packages/nitrate/mutable.py", line 368, in sortkey if caseplan.testcase == testcase][0] IndexError: list index out of range The code is try: caseplan = [caseplan for caseplan in self.caseplans if caseplan.testcase == testcase][0] except KeyError: raise NitrateError("No CasePlan for {0} in {1} found".format( testcase.identifier, self.identifier)) It should except IndexError since we're accessing an array. Or maybe a LookupError if both array and dectionary lookup might fail.