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

Issue #3254264 by Xiaohua Guan, yas: Accept VPC peering connection from Cloud...

Issue #3254264 by Xiaohua Guan, yas: Accept VPC peering connection from Cloud Orchestrator master to workers (AWS Cloud)
parent 4bed7152
No related branches found
No related tags found
No related merge requests found
......@@ -44,21 +44,26 @@ class VpcPeeringConnectionAcceptForm extends AwsDeleteUpdateEntityForm {
'VpcPeeringConnectionId' => $this->entity->getVpcPeeringConnectionId(),
]);
if (empty($result['VpcPeeringConnection'])) {
$form_state->setRedirect("view.{$this->entity->getEntityTypeId()}.list", ['cloud_context' => $this->entity->getCloudContext()]);
if ($result === NULL) {
$this->processOperationErrorStatus($entity, 'accepted');
return;
}
else {
// Update the VPC.
$this->ec2Service->updateVpcPeeringConnections([
'VpcPeeringConnectionIds' => [$this->entity->getVpcPeeringConnectionId()],
], FALSE);
$this->processOperationStatus($entity, 'accepted');
if (!empty($result['SendToWorker'])) {
$this->processOperationStatus($entity, 'accepted remotely');
return;
}
// Update the VPC.
$this->ec2Service->updateVpcPeeringConnections([
'VpcPeeringConnectionIds' => [$this->entity->getVpcPeeringConnectionId()],
], FALSE);
$this->processOperationStatus($entity, 'accepted');
$this->clearCacheValues($entity->getCacheTags());
$this->dispatchSubmitEvent($entity);
$form_state->setRedirect("view.{$this->entity->getEntityTypeId()}.list", ['cloud_context' => $this->entity->getCloudContext()]);
}
}
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