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
This commit is contained in:
zhuyue 2022-01-11 17:59:39 +08:00 committed by zhu yue
parent 7419565aa2
commit 9bfc537493

View File

@ -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;
});