infobloxopen/infoblox-client

CNAME records can not be searched by `canonical`

Closed this issue · 2 comments

CNAME records cannot be searched by canonical, all CNAME records are returned instead.

objects.CNAMERecord.search(
    connector=conn,
    canonical="an.example.com",
    view='External'
)

This seems to still be an issue in 0.4.25. Is there a fix or work around?

@moet78, @markeganfuller hi. I can't find the 0.4.25 version of the infoblox-client seems like it was deleted.

But this issue was fixed in the version 0.5.0 of the client.

Root-cause analysis

In version 0.4.23 the attribute _all_searchable_fields of CNAMERecord class did not contain the canonical field:
https://github.com/infobloxopen/infoblox-client/blob/0.4.23/infoblox_client/objects.py#L1075-L1077

That's why you were unable to find CNAME Record by the canonical field.

In version 0.5.0 however, the canonical field was added to _all_searchable_fields attribute:
https://github.com/infobloxopen/infoblox-client/blob/v0.5.0/infoblox_client/objects.py#L13001

I've tried to reproduce this issue on client version v0.5.0 and successfully found CNAMERecord by the canonical field. So, I will close this issue after some time if no other related problems will arise.