mirror of https://github.com/ansible/ansible.git
Azure RM: Fix missing ipConfiguration 'primary' attribute (#63722)
If a NIC has no primary ipConfiguration, the 'primary' field returned by Azure is set to 'null' thus removed from the 'nic_model' ipConfigurations properties. Unfortunately the code generating the hostvars dict. assumes the 'primary' key always exists, leading the entire host parsing to fail. This patch changes the way the 'primary' field is accessed by using the dict. 'get' method with a default value set to 'False'. Resolves #63721 Testing Done: Run ansible-inventory with an azure_rm plugin that points to a resource group that contain a two VMs, on with a primary ipConfiguration and another one without. Check that without the patch the inventory output does not contain the VMs (or just the one with the primary ipConfiguration set, depending on the VM names). Finally check that with the patched azure_rm.py file, both VMs show up.pull/65317/head
parent
4c589661c2
commit
4b240a5d74
Loading…
Reference in New Issue