Bug 862523 - Handle non-existent categories gracefully
Handle non-existent categories gracefully
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: python-nitrate (Show other bugs)
rawhide
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Petr Šplíchal
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-03 02:52 EDT by Petr Šplíchal
Modified: 2016-05-31 21:43 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-01-07 13:52:42 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 Petr Šplíchal 2012-10-03 02:52:08 EDT
Description of problem:

python-nitrate should gracefully handle non-existent categories.

Version-Release number of selected component (if applicable):
python-nitrate-0.9-0.el6.noarch

Steps to Reproduce:
>>> print Category(product="RHEL Tests", category="Bad name").id

Actual results:
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.6/site-packages/nitrate/api.py", line 192, in getter
    self._get()
  File "/usr/lib/python2.6/site-packages/nitrate/api.py", line 657, in _get
    self.name, self.product.id)
  File "/usr/lib64/python2.6/xmlrpclib.py", line 1199, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib64/python2.6/xmlrpclib.py", line 1489, in __request
    verbose=self.__verbose
  File "/usr/lib/python2.6/site-packages/nitrate/xmlrpc.py", line 127, in request_with_cookies
    return self._parse_response(h.getfile(), sock)
  File "/usr/lib64/python2.6/xmlrpclib.py", line 1392, in _parse_response
    return u.close()
  File "/usr/lib64/python2.6/xmlrpclib.py", line 838, in close
    raise Fault(**self._stack[0])
xmlrpclib.Fault: <Fault 1: 'DoesNotExist: TestCaseCategory matching query does not exist.'>

Expected results:
NitrateError exception raised.
Comment 1 Petr Šplíchal 2012-12-07 15:03:39 EST
Fix for this pushed to git:
https://github.com/psss/python-nitrate/commit/cd81ebd

The example above would result in the following traceback:

>>> print Category(product="RHEL Tests", category="Bad name").id
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.6/site-packages/nitrate/api.py", line 238, in getter
    self._get()
  File "/usr/lib/python2.6/site-packages/nitrate/api.py", line 752, in _get
    self.name, self.product.name))
nitrate.xmlrpc.NitrateError: Category 'Bad name' not found in 'RHEL Tests'
Comment 2 Fedora Update System 2012-12-10 07:42:03 EST
python-nitrate-0.9-0.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/python-nitrate-0.9-0.el6
Comment 3 Fedora Update System 2012-12-10 07:48:58 EST
python-nitrate-0.9-0.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/python-nitrate-0.9-0.fc16
Comment 4 Fedora Update System 2012-12-10 07:48:58 EST
python-nitrate-0.9-0.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/python-nitrate-0.9-0.fc18
Comment 5 Fedora Update System 2012-12-10 07:49:03 EST
python-nitrate-0.9-0.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/python-nitrate-0.9-0.fc17
Comment 6 Fedora Update System 2012-12-11 02:47:28 EST
python-nitrate-0.9-0.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/FEDORA-EPEL-2012-13721/python-nitrate-0.9-0.el6
Comment 7 Fedora Update System 2012-12-19 03:32:59 EST
python-nitrate-0.9-0.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 8 Fedora Update System 2012-12-19 03:43:36 EST
python-nitrate-0.9-0.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 9 Fedora Update System 2013-01-07 13:52:44 EST
python-nitrate-0.9-0.el6 has been pushed to the Fedora EPEL 6 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 10 Fedora Update System 2013-01-11 20:10:07 EST
python-nitrate-0.9-0.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.

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