From 750c29f2fc539cadd2522a4b56990ccf75546fe2 Mon Sep 17 00:00:00 2001 From: Adam Grare Date: Tue, 27 Aug 2024 12:03:07 -0400 Subject: [PATCH] Fix Azure CloudSubnet missing address_prefix Azure moved from a single static Subnet.addressPrefix to an array of addressPrefixes in the newer API version. The older API version would return no addressPrefix causing a NoMethodError. --- .../providers/azure/inventory/parser/network_manager.rb | 6 ++++-- config/settings.yml | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/models/manageiq/providers/azure/inventory/parser/network_manager.rb b/app/models/manageiq/providers/azure/inventory/parser/network_manager.rb index 56a02563..47be1f03 100644 --- a/app/models/manageiq/providers/azure/inventory/parser/network_manager.rb +++ b/app/models/manageiq/providers/azure/inventory/parser/network_manager.rb @@ -80,11 +80,13 @@ def cloud_networks def cloud_subnets(persister_cloud_networks, cloud_network) cloud_network.properties.subnets.each do |subnet| - uid = subnet.id + uid = subnet.id + cidr = subnet.properties.address_prefixes.first + persister.cloud_subnets.build( :ems_ref => uid, :name => subnet.name, - :cidr => subnet.properties.address_prefix, + :cidr => cidr, :cloud_network => persister_cloud_networks, :availability_zone => persister.availability_zones.lazy_find('default'), :network_router => persister.network_routers.lazy_find(subnet.properties.try(:route_table).try(:id)) diff --git a/config/settings.yml b/config/settings.yml index deaaf281..7c851b4d 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -16,7 +16,7 @@ :storage_disk: "2017-03-30" :template_deployment: "2017-08-01" :virtual_machine: "2017-12-01" - :virtual_network: "2017-11-01" + :virtual_network: "2023-11-01" :blacklisted_event_names: - storageAccounts_listKeys_BeginRequest - storageAccounts_listKeys_EndRequest