Skip to content
Snippets Groups Projects
Commit ffce0d17 authored by Yas Naoi's avatar Yas Naoi
Browse files

Issue #2736821: aws_cloud - Fixed a bug at Terminate Instance operation

parent 6fb3236e
No related branches found
No related tags found
No related merge requests found
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
* Contains \Drupal\aws_cloud\Form\Ec2\InstanceDeleteForm. * Contains \Drupal\aws_cloud\Form\Ec2\InstanceDeleteForm.
*/ */
// Updated by yas 2016/09/06
// Updated by yas 2016/06/12 // Updated by yas 2016/06/12
// Updated by yas 2016/05/31 // Updated by yas 2016/05/31
// Updated by yas 2016/05/30 // Updated by yas 2016/05/30
...@@ -17,6 +18,7 @@ ...@@ -17,6 +18,7 @@
namespace Drupal\aws_cloud\Form\Ec2; namespace Drupal\aws_cloud\Form\Ec2;
use Drupal\cloud\Form\CloudContentDeleteForm; use Drupal\cloud\Form\CloudContentDeleteForm;
use Drupal\aws_cloud\Entity\Config\Config;
use Drupal\aws_cloud\Controller\Ec2\ApiController; use Drupal\aws_cloud\Controller\Ec2\ApiController;
/** /**
...@@ -43,7 +45,7 @@ class InstanceDeleteForm extends CloudContentDeleteForm { ...@@ -43,7 +45,7 @@ class InstanceDeleteForm extends CloudContentDeleteForm {
]); ]);
$result = $apiController->terminateInstance($entity); $result = $apiController->terminateInstance($entity);
if(isset($result[0]['InstanceId'])) { if(isset($result['TerminatingInstances'][0]['InstanceId'])) {
$status = 'status'; $status = 'status';
$message = $this->t('The @type "@label" has been terminated.', [ $message = $this->t('The @type "@label" has been terminated.', [
...@@ -56,6 +58,7 @@ class InstanceDeleteForm extends CloudContentDeleteForm { ...@@ -56,6 +58,7 @@ class InstanceDeleteForm extends CloudContentDeleteForm {
drupal_set_message($message, $status); drupal_set_message($message, $status);
$apiController->updateInstanceList(Config::load($entity->cloud_context()));
$form_state->setRedirectUrl($this->getCancelUrl()); $form_state->setRedirectUrl($this->getCancelUrl());
} }
} }
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