saltstack/salt — pull request #6505 by mgwilliams (2013-08-02 21:52:49+00:00)
Title: Ddns

This commit fixes several bugs and inadequacies in the ddns execution module.

1) add_host and delete_host were not properly handling reverse records. Fixed.
2) delete_host was not handling reverse records when there were multiple A records. It now deletes all corresponding reverse records.
3) delete_host now deletes all matching (forward) records, not just A. E.g., TXT records (which are sometimes created by dhcp ddns updates) are now deleted along with the A and PTR records.
4) I've removed the note in the docstrings about how PTR records are added/deleted. I don't think this is necessary in the end user docs -- the comment within the code should be adequate.

Known remaining issue: add_host with replace=True will leave a hanging PTR record if the IP for the host is updated. I think the best solution is to simply call delete_host first when replace=True. I will fix that in an upcoming commit.