fixing dns server delete record in all roles#253
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the DNS record deletion logic across the Active Directory, FreeIPA, and Samba roles to query and delete records directly using provider-specific tools rather than relying on generic dig commands, and adds IPv6 support to the network device utility. However, the refactored deletion logic introduces several critical issues that must be addressed: multiple potential TypeError exceptions from slicing or checking None values, a logic inversion in Samba where deletion only occurs if no records are found, an AttributeError on self.zone, a typo in raise_on_error, and several Python runtime errors in FreeIPA (such as calling the non-existent trim() method and unpacking errors).
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
86b2135 to
d96150a
Compare
thalman
left a comment
There was a problem hiding this comment.
Overall looks good. See my question about add_device.
08891e8 to
a5bc137
Compare
spoore1
left a comment
There was a problem hiding this comment.
Overall looks good and from testing it's working. I have a few nit-picks (optional mostly) and one actual question about the version pinning for pytest-mh.
05fda02 to
0894b99
Compare
|
I have to redo the entire ipa logic because it was only returning one record. Looking back on this, knowing how complex it is now, I would have added more methods to find the record, get the record, etc. It may be beneficial if the look-up is faster than the dig. I think this will work in the interim. |
|
Increasing the retry/delay to a total of 120 seconds, from the run in IDMCI. |
|
working in idmci |
6a51c4b to
8c066b2
Compare
The dig query is insufficient because it may be cached, failing when called because it attempts to delete a record that doesn't exist in the zone.
The method logic, at a high level, goes like this: because we pass in one parameter, we need to resolve the IP address from the hostname, which may return multiple addresses. We then iterate through the zones to determine the type of record. There may be a case where the A record is deleted, but still needs to iterate through because the PTR record exists. Then we determine if it's an IPv4 or IPv6 address. Each type of record requires a different argument to delete it properly, and then there is a lot of formatting required.