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
Loading
Loading
Loading
Loading
+13 −8
Original line number Diff line number Diff line
@@ -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;
    }

    if (!empty($result['SendToWorker'])) {
      $this->processOperationStatus($entity, 'accepted remotely');
      return;
    }
    else {

    // 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()]);
  }

}