[Unbound-users] accesing config_stub from pythonmod

Anton Tereshchenkov paystee at gmail.com
Wed Jun 5 03:03:51 UTC 2013


Hello,

I have two forward zones defined in config file:
forward-zone:
        name: "somedomain.com."
        forward-addr: 8.8.8.8
        forward-addr: 8.8.4.4

forward-zone:
        name: "anotherone.net."
        forward-addr: 8.8.8.8
        forward-addr: 8.8.4.4

And when I try to get their names from init function using pythonmod:
  def init(id, cfg):
    cfg.forwards.next()
    print cfg.forwards.name
    return True

Attribute error is raised ('SwigPyObject' object has no attribute 'name').
Same when I'm trying to access any other attribute defined in struct
config_stub (addrs, hosts, isfirst).

And one more thing... can't access to mod_env global variable since it is
set to None.
  print type(mod_env)
  <type 'NoneType'>

Using unbound version 1.4.20
Am I missing something?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nlnetlabs.nl/pipermail/unbound-users/attachments/20130605/f3e656a1/attachment.htm>


More information about the Unbound-users mailing list