outini/python-powerdns

suggest_zone doesn't handle hyphen properly

Opened this issue · 0 comments

I have zones "company.com" and "prt.company.com". If I call Server.suggest_zone('foo-prt.company.com.') I get back the zone "prt.company.com" instead of "company.com".

Looking at https://github.com/outini/python-powerdns/blob/master/powerdns/interface.py#L241 it seems that you need to modify it to check for a dot, like so

if r_name.endswith('.' + zone.name):