BIND 10 #2298: Xfrout/zones and XML stats
BIND 10 Development
do-not-reply at isc.org
Tue Nov 6 13:26:03 UTC 2012
#2298: Xfrout/zones and XML stats
-------------------------------------+-------------------------------------
Reporter: jreed | Owner: naokikambe
Type: | Status: reviewing
defect | Milestone:
Priority: | Sprint-20121106
medium | Resolution:
Component: | Sensitive: 0
statistics | Sub-Project: Core
Keywords: | Estimated Difficulty: 5
Defect Severity: N/A | Total Hours: 2
Feature Depending on Ticket: |
Add Hours to Ticket: 0 |
Internal?: 0 |
-------------------------------------+-------------------------------------
Comment (by naokikambe):
Hello,
Thank you for reviewing.
Replying to [comment:18 jelte]:
> Very general, and unrelated note: b10-statshttpd prints GET requests to
stderr directly. This should be done through the logging api (perhaps by
making a tiny class that acts as a stream that can be printed to, if the
source of these messages is the python http module)
>
> Probably because of the above, make check prints a lot of mostly
uninteresting crap (at least, when the tests pass :p) and it may be non-
obvious that it is skipping some if you don't have python3-lxml installed.
Yes, I know that, but I believe this issue would be resolved on #1897. So
I'd like to separate this issue from this ticket. This ticket is already
so big:(.
> send_head() (lines 124+):
>
> the code could use a few comments as to what it is doing here, I see a
lot of path modifications, but it is not directly clear what is being
modified and why (in the first case of the if at line 125)
I've added comments related to the path preparation at
{{{
71410ff [2298_7] add an example of the path in docstring of xml_handler()
d54f479 [2298_7] add comments about preparation of the requested path,
regarding the condition that it is started with X
f0ab6da [2298_7] add description about evaluating the requested path in
each if-condition
}}}
> open_template() (lines 553+):
...
> this can be done slightly more straightforward with a 'with'-statement:
>
> {{{
> try:
> with open(file_name, 'r') as f:
> lines = "".join(f.readlines())
> except IOError as err:
> raise StatsHttpdDataError(
> "%s: %s" % (err.__class__.__name__, err))
> }}}
Thank you, I've revised as you commented.
{{{
932dcb6 [2298_7] use with-statement instead of try-except-finally
statement
}}}
> b10-stats-httpd_test.py:
>
> in test_do_GET's check_XML_URL_PATH (lines 256+):
>
> Not entirely sure if root.find('item') is supposed to ever return
anything, but in the current set of tests it is always an empty iterator,
and the checks in that final loop are never reached.
> (I was looking to see why the check at line 260 is an assertFalse, not
an assertTrue)
It was an empty iteration. I missed. I removed find(). I think it would be
run. And I've added comments about the tests in the iteration.
{{{
3e9d625 [2298_7] add comments about checking each 'item' element under the
root element
3097176 [2298_7] remove find() so that each element 'item' under the root
element is checked (actually this test wasn't
}}}
Regards,
--
Ticket URL: <http://bind10.isc.org/ticket/2298#comment:19>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development
More information about the bind10-tickets
mailing list