infobloxopen / infoblox-ansible

Ansible modules for interfacing to Infoblox systems
GNU General Public License v3.0
54 stars 60 forks source link

Enforce selecting ref from network_obj based on network view #157

Closed philipsd6 closed 1 year ago

philipsd6 commented 1 year ago

Since there can be multiple network views containing the same networks, we need to ensure that the correct network in the network_obj list is picked based on a network view name, instead of simply taking it from the first one in the list. The 'default' view is used by default.

Fixes: #156

ranjishmp commented 1 year ago

Hi @hemanthKa677, please review this PR

philipsd6 commented 1 year ago

Well, I didn't update any test fixtures because there were no test fixtures in the first place for the lookup plugins. I'll try to take a look to see how we can add test fixtures for lookup plugins and add that. However, this is a small easily reviewed change where the only new implication is that the lookup could fail if an Infoblox system doesn't have a 'default' network view and the user doesn't specify the desired view.

But fwiw, I tested the code directly in our Infoblox test sytem - replicating the error that occurs when the 'default' view is not the first one in the list, and then having it run correctly with the code I added to the plugin.

philipsd6 commented 1 year ago

@hemanthKa677 Done as requested.