Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PtrRecordV4 (and possible PtrRecordV6) missing "name" in _search_for_update_fields? #325

Open
dudefellah opened this issue Jun 29, 2022 · 3 comments

Comments

@dudefellah
Copy link

Hi,

I've been trying to create some PTR records for bonjour (b._dns-sd._udp and lb._dns-sd._udp) that use ptrdname to point to a (sub)domain. When I try to create these records with the Python API client, I see that there's no way to distinguish between one record or the other since the initial search looks for ['ptrdname', 'view', 'ipv4addr'], so with both records having the same ptrdname domain value, I get the first created record both times.

Eg. creation of b._dns-sd._udp leads to a search for: {"view": "my_view", "ptrdname": "mydomain.com"}, to decide if the record already exists or not, then when I try to add lb._dns-sd._udp, it once again searches for {"view": "my_view", "ptrdname": "mydomain.com"} which returns the record for b._dns-sd._udp instead of giving no record since lb._dns-sd._udp hasn't been created yet.

If I add name into the _search_for_update_fields in PtrRecordV4, I fix this problem for myself, but I haven't put enough thought into how this'll impact other "normal" PTR record functions to want to create a pull request, but I can if you'll find that helpful.

@dudefellah
Copy link
Author

There's also a slightly different issue to add to this. As I'm trying to create a local workaround, I'm manually fetching a PTR record (with the name) in order to update it, or create it if the fetch failed. When doing the update on a PTR record where I'm only concerned with the ptrdname field, this Infoblox library sends back a blank ipv4addr field to the Infoblox appliance, which the Infoblox API doesn't like. I worked around this issue locally by manually modifying _updateable_search_fields to not include ipv4addr. It probably needs a fix in the library though.

@sarya-infoblox
Copy link
Collaborator

Hi @dudefellah

We are working on a new release right now, we will look at this issue as soon as we get time.

@sarya-infoblox
Copy link
Collaborator

Hi @dudefellah,

This issue seems to be a big enhancement as the changes you are suggesting are related to Objects.py which has a lot of backward compatibility with different plugins. Also, we can’t remove the 'ipv4addr' field from '_updateable_search_fields' as this field is a dependent field for multiple Operations like Updating the record, Creating a new record, etc.

We can look into this issue in our future releases. Thanks for your efforts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants