BIND 10 #983: Python wrappers for ACLs

BIND 10 Development do-not-reply at isc.org
Wed Jul 13 11:45:20 UTC 2011


#983: Python wrappers for ACLs
-------------------------------------+-------------------------------------
                   Reporter:         |                 Owner:  jinmei
  vorner                             |                Status:  reviewing
                       Type:  task   |             Milestone:
                   Priority:  major  |  Sprint-20110802
                  Component:         |            Resolution:
  Unclassified                       |             Sensitive:  0
                   Keywords:         |           Sub-Project:  DNS
            Defect Severity:  N/A    |  Estimated Difficulty:  5.0
Feature Depending on Ticket:  ACL    |           Total Hours:  0
        Add Hours to Ticket:  0      |
                  Internal?:  0      |
-------------------------------------+-------------------------------------
Changes (by vorner):

 * owner:  vorner => jinmei


Comment:

 Replying to [comment:15 jinmei]:
 > > > >  * The functions that construct the ACLs take strings. I get it is
 the same as with the logging, but the logging is not really exposed, it is
 used from within the ModuleConfig thing. This might be used externally, do
 you think it makes sense to accept the list argument directly (and call
 the conversion to string to be used from within the C++ code)?
 > [...]
 > > Well, I didn't really mean writing C++ code to do the conversion. My
 idea was to take the object passed as a parameter, somehow load the
 json.dumps function (which is the python function used to convert to
 string) and call it with `PyObject_CallObject`, so effectively using the
 python function from C++ code. It should even handle parameter parsing.
 > >
 > > Having a python wrapper sounds reasonably as well, but it looks more
 tricky to me.
 > >
 > > Anyway, it probably isn't so much a problem, so if the solutions both
 look complicated, I'm OK with the current interface ‒ I just thought it
 could be more convenient.
 >
 > I thought this would be on borderline in that we'd probably want to
 > keep the bindings as straightforward as possible.  But as I tried it I
 > found it did not require too much of new code in this specific case,
 > so I implemented it anyway.  I'm still not sure if we want to
 > including this portion or not, so I'm okay either with or without it.
 > Note also that I've updated pycppwrapper_util.h to help implement this
 > feature (it was not absolutely necessary, but I wanted to keep the
 > code concise and still safer with the help of the wrapper interfaces).

 I think, when it is already written and is quite short, we might want to
 include it. It will be more convenient and more the python way.

 But, the `PyImport_AddModule` ‒ it does not ensure the module is actually
 loaded into the interpretter (if somethind didn't load it before, it
 returns an empty module). Can we expect it is already loaded, as in the
 case of isc.acl.acl?

 The documentation for the loader is taken from the C++ one and it speaks
 about loading the checks. There's no function and no binding for the
 checks currently, should that part be removed?

 Thank you

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


More information about the bind10-tickets mailing list