Skip to content
Snippets Groups Projects
Commit 7f2974a1 authored by xiaohua guan's avatar xiaohua guan Committed by Yas Naoi
Browse files

Issue #3177711 by Xiaohua Guan, yas: Fix Wavelength Elastic IP management (listing view)

parent 55f17107
No related branches found
No related tags found
No related merge requests found
......@@ -601,6 +601,8 @@ class Ec2BatchOperations {
$uid = $ec2Service->getUidTagValue($elastic_ip, ElasticIp::TAG_CREATED_BY_UID);
$entity_id = $ec2Service->getEntityId('aws_cloud_elastic_ip', 'public_ip', $elastic_ip['PublicIp']);
$public_ip = $elastic_ip['PublicIp'] ?? $elastic_ip['CarrierIp'];
// Skip if $entity already exists, by updating 'refreshed' time.
if (!empty($entity_id)) {
$entity = ElasticIp::load($entity_id);
......@@ -615,6 +617,7 @@ class Ec2BatchOperations {
$entity->setAllocationId($elastic_ip['AllocationId'] ?? '');
$entity->setAssociationId($elastic_ip['AssociationId'] ?? '');
$entity->setDomain($elastic_ip['Domain'] ?? '');
$entity->setPublicIp($public_ip);
$entity->setRefreshed($timestamp);
$uid > 0 ?: $entity->setOwnerById($uid);
......@@ -628,7 +631,7 @@ class Ec2BatchOperations {
$entity = ElasticIp::create([
'cloud_context' => $cloud_context,
'name' => $name,
'public_ip' => $elastic_ip['PublicIp'],
'public_ip' => $elastic_ip['PublicIp'] ?? $elastic_ip['CarrierIp'],
'instance_id' => $elastic_ip['InstanceId'] ?? '',
'network_interface_id' => $elastic_ip['NetworkInterfaceId'] ?? '',
'private_ip_address' => $elastic_ip['PrivateIpAddress'] ?? '',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment