From 9bfc537493c95e83372a22526a1ea90d65344615 Mon Sep 17 00:00:00 2001 From: zhuyue Date: Tue, 11 Jan 2022 17:59:39 +0800 Subject: [PATCH] fix: Fix for fip's binding resource that not belong to current project fix for fip's binding resource that not belong to current project Change-Id: I26e52a4a31e7dd12023fe5fabfb748eb328870f2 --- src/stores/neutron/floatingIp.js | 45 ++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/src/stores/neutron/floatingIp.js b/src/stores/neutron/floatingIp.js index ded7dcc8..c096664e 100644 --- a/src/stores/neutron/floatingIp.js +++ b/src/stores/neutron/floatingIp.js @@ -107,26 +107,31 @@ export class FloatingIpStore extends Base { promises.push(Promise.resolve({})); } }); - const results = await Promise.all(promises); - results.forEach((result, index) => { - let resource_name = ''; - if ( - allData[index].port_details && - allData[index].port_details.device_owner === 'compute:nova' - ) { - resource_name = `${result.name}: ${allData[index].fixed_ip_address}`; - } else if ( - allData[index].port_details && - (allData[index].port_details.device_owner === - 'network:router_gateway' || - allData[index].port_details.device_owner === '') - ) { - resource_name = `${result.name}: ${allData[index].fixed_ip_address}`; - } else if ( - allData[index].port_details && - allData[index].port_details.device_owner === 'Octavia' - ) { - resource_name = `${result.name}: ${allData[index].fixed_ip_address}`; + const results = await Promise.allSettled(promises); + results.forEach(({ status, value: result }, index) => { + let resource_name = '-'; + if (status === 'fulfilled') { + if ( + allData[index].port_details && + allData[index].port_details.device_owner === 'compute:nova' + ) { + resource_name = `${result.name}: ${allData[index].fixed_ip_address}`; + } else if ( + allData[index].port_details && + (allData[index].port_details.device_owner === + 'network:router_gateway' || + allData[index].port_details.device_owner === '') + ) { + resource_name = `${result.name}: ${allData[index].fixed_ip_address}`; + } else if ( + allData[index].port_details && + allData[index].port_details.device_owner === 'Octavia' + ) { + resource_name = `${result.name}: ${allData[index].fixed_ip_address}`; + } + } else { + // deal with resources from other projects + resource_name = `${t('Resource Id')}: ${allData[index].port_details.device_id} `; } allData[index].resource_name = resource_name; });