Bug 1312770
Summary: | Undefined response_time in finally section of udp() (upstream has fix for this problem) | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Anatoly <tolyator> |
Component: | python-dns | Assignee: | Charalampos Stratakis <cstratak> |
Status: | CLOSED ERRATA | QA Contact: | Jan Houska <jhouska> |
Severity: | unspecified | Docs Contact: | Marc Muehlfeld <mmuehlfe> |
Priority: | unspecified | ||
Version: | 7.2 | CC: | cstratak, isenfeld, jhouska, lmiksik, mmuehlfe, pviktori, qe-baseos-apps, tolyator |
Target Milestone: | rc | Keywords: | Patch |
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | python-dns-1.12.0-2.20150617git465785f.el7 | Doc Type: | Bug Fix |
Doc Text: |
Undefined variable in the `udp()` function of the _python-dns_ toolkit is now set
Previously, the _python-dns_ toolkit used an undefined `response_time` variable in the *finally* section of the `udp()` function. As a consequence, an incorrect exception was displayed to the user. This bug has been fixed and the correct exception is returned.
|
Story Points: | --- |
Clone Of: | Environment: | ||
Last Closed: | 2016-11-04 04:30:58 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: | |||
Bug Depends On: | |||
Bug Blocks: | 1305230 |
Description
Anatoly
2016-02-29 09:21:43 UTC
Could you provide a reproducer? #!/usr/bin/python from dns.resolver import Resolver r = Resolver() r.nameservers = [ '127.0.0.1', ] r.timeout = 2 r.lifetime = 2 answers = r.query( 'redhat.com', 'SOA', source_port = 53 ) This script should be started on host with port 53/udp assigned e.g. on host with named started. Results on host with patch: Traceback (most recent call last): File "./query-bug.py", line 9, in <module> answers = r.query( 'redhat.com', 'SOA', source_port = 53 ) File "/usr/lib/python2.7/site-packages/dns/resolver.py", line 857, in query timeout = self._compute_timeout(start) File "/usr/lib/python2.7/site-packages/dns/resolver.py", line 769, in _compute_timeout raise Timeout(timeout=duration) dns.exception.Timeout: The DNS operation timed out after 2.00053596497 seconds Results with not patched version of python-dns: Traceback (most recent call last): File "./query-bug.py", line 9, in <module> answers = r.query( 'redhat.com', 'SOA', source_port = 53 ) File "/usr/lib/python2.7/site-packages/dns/resolver.py", line 869, in query source_port=source_port) File "/usr/lib/python2.7/site-packages/dns/query.py", line 227, in udp response_time = time.time() - begin_time UnboundLocalError: local variable 'begin_time' referenced before assignment Correct result for this case is dns.exception.Timeout incorrect results is UnboundLocalError Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHBA-2016-2354.html |