Bug 481 - unbound-python module bug
unbound-python module bug
Status: RESOLVED FIXED
Product: unbound
Classification: Unclassified
Component: server
1.4.18
All Linux
: P5 trivial
Assigned To: unbound team
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-11-30 04:54 CET by liuben
Modified: 2013-04-18 15:33 CEST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description liuben 2012-11-30 04:54:08 CET
yes, we want use python module for some special function but we find it difficult to communicate with unbound-control, because all variables that can keep our private data are None, so can you give me some advises? 

bugs:
first:
  print mod_env.fname   # Print module script name
  mod_env.data = "test" # Store global module data

  above code was wrong, because mod_env was None, and exception as follows

  >>>>>> AttributeError: 'NoneType' object has no attribute 'fname'

  above code find in       >>>>>>>http://unbound.net/documentation/pythonmod/examples/example0.html

second:
   function: operate(id, event, qstate, qdata)
   why no data pass to python module because qdata was always None
third:
   why inform_super(id, qstate, superqstate, qdata) function not execute, and how  or when can i active it ?



thank you.
Comment 1 Wouter Wijngaards 2012-11-30 10:40:25 CET
Hi Liuben,

Fixed the mod_env in example0, thank you.

The qdata is where you can store your data.  The inform_super function is called when a substate informs its superstate.

Questions about the python API are more appropriate for the unbound users mailing list, you can find it here: 
http://unbound.nlnetlabs.nl/mailman/listinfo/unbound-users

Best regards,
   Wouter
Comment 2 Wouter Wijngaards 2013-04-18 15:33:41 CEST
This issue is believed to be fixed.
Best regards, Wouter