BIND 10 #1179: python interface for data source

BIND 10 Development do-not-reply at isc.org
Thu Sep 22 16:28:12 UTC 2011


#1179: python interface for data source
-------------------------------------+-------------------------------------
                   Reporter:         |                 Owner:  jelte
  jinmei                             |                Status:  reviewing
                       Type:  task   |             Milestone:
                   Priority:  major  |  Sprint-20110927
                  Component:  data   |            Resolution:
  source                             |             Sensitive:  0
                   Keywords:         |           Sub-Project:  DNS
            Defect Severity:  N/A    |  Estimated Difficulty:  4
Feature Depending on Ticket:         |           Total Hours:  0
        Add Hours to Ticket:  0      |
                  Internal?:  0      |
-------------------------------------+-------------------------------------
Changes (by vorner):

 * owner:  vorner => jelte


Comment:

 Hello

 First, I had a failure in the tests:
 {{{
 FAIL: test_iterate (__main__.DataSrcClient)
 ----------------------------------------------------------------------
 Traceback (most recent call last):
   File
 "/home/vorner/work/bind10/src/lib/python/isc/datasrc/tests/datasrc_test.py",
 line 76, in test_iterate
     rrs.get_next_rrset().to_text())
 AssertionError: 'sql1.example.com. 3600 IN RRSIG SOA 5 3 3600
 20100322084536 20100220084536 1244 [truncated]... != 'sql1.example.com.
 3600 IN RRSIG DNSKEY 5 3 3600 20100322084536 20100220084536 1
 [truncated]...
 - sql1.example.com. 3600 IN RRSIG SOA 5 3 3600 20100322084536
 20100220084536 12447 sql1.example.com. FAKEFAKEFAKEFAKE
 - sql1.example.com. 3600 IN RRSIG NS 5 3 3600 20100322084536
 20100220084536 12447 sql1.example.com. FAKEFAKEFAKEFAKE
 - sql1.example.com. 3600 IN RRSIG NSEC 5 3 7200 20100322084536
 20100220084536 12447 sql1.example.com. FAKEFAKEFAKEFAKE
   sql1.example.com. 3600 IN RRSIG DNSKEY 5 3 3600 20100322084536
 20100220084536 12447 sql1.example.com. FAKEFAKEFAKEFAKE
   sql1.example.com. 3600 IN RRSIG DNSKEY 5 3 3600 20100322084536
 20100220084536 33313 sql1.example.com. FAKEFAKEFAKEFAKE
 + sql1.example.com. 3600 IN RRSIG NS 5 3 3600 20100322084536
 20100220084536 12447 sql1.example.com. FAKEFAKEFAKEFAKE
 + sql1.example.com. 3600 IN RRSIG SOA 5 3 3600 20100322084536
 20100220084536 12447 sql1.example.com. FAKEFAKEFAKEFAKE
 + sql1.example.com. 3600 IN RRSIG NSEC 5 3 7200 20100322084536
 20100220084536 12447 sql1.example.com. FAKEFAKEFAKEFAKE
 }}}

 This is output after I turned off the truncation of errors. I guess it's
 not guaranteed to be in any order if it is different RRsets. What should
 we do? Test a zone that is not signed? Allow reordering with RRsigs?
 Because this order is implementation dependant and probably even random-
 way-stored-in-DB dependant.

 Why is this called _log_libdir?
 {{{
 loglibdir = os.path.join(base, 'isc/datasrc/.libs')
 }}}

 And, it seems, this branch was a huge copy-paste from somewhere. For
 example, this looks as copied from somewhere (the acl module):
 {{{
 // The __init__.py file should ensure isc.acl.acl has been loaded by the
 time
 }}}

 As well as this (it talks about a generic template for descructor, maybe
 that could be removed, multiple times):
 {{{#!C++
 // This is a template of typical code logic of python object destructor.
 // In many cases you can use it without modification, but check that
 carefully.
 void
 DataSourceClient_destroy(s_DataSourceClient* const self) {
 }}}

 Another thing is, I don't mind having the find methods, etc, directly on
 the updater. But the wrappers are nearly identical copies of each other
 and they are not really short. Is there a way to do it in some kind of
 templateish way and share the same code?

 I guess you should go through the semi-auto generated documentation. A lot
 of it talks about stuff that is irrelevant to python, makes no sense in
 python or is just plain wrong. It talks about constructors, classes that
 are not visible from python at all, std.bad_alloct exceptions, protected
 constructors (there's no protected in python), NULL pointers. It is also
 badly formated sometimes (like TodoSome sentence, some parts of enums are
 there twice, sometimes a sentence is missing or there are \n\ sequences,
 which might be correct, but they look strange).

 And I'd like to note, that there are some changes from #1176 (like another
 flag for the find method) and there'll be more from #1177 (more status
 codes from find, extra method on finder). When should these be added?
 Whoever merges first wins and the other one needs to implement them?

 Otherwise, the code looks quite straight-forward and I like the way the
 return values are converted (createRRClassObject).

 Thanks

-- 
Ticket URL: <http://bind10.isc.org/ticket/1179#comment:10>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development


More information about the bind10-tickets mailing list