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

#2736821 aws_cloud - refactored delete operations

parent e15b81e5
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,7 @@
* Contains \Drupal\aws_cloud\Aws\Ec2\ImageInterface.
*/
// Updated by yas 2016/06/12
// Updated by yas 2016/05/30
// Updated by yas 2016/05/29
// Updated by yas 2016/05/28
......@@ -36,6 +37,11 @@ interface ImageInterface extends ContentEntityInterface, EntityOwnerInterface {
*/
public function image_id();
/**
* {@inheritdoc}
*/
public function setImageId($image_id = '');
/**
* {@inheritdoc}
*/
......
<?php
// Updated by yas 2016/06/12
// Updated by yas 2016/05/30
// Updated by yas 2016/05/29
// updated by yas 2016/05/28
......@@ -86,6 +87,13 @@ class Image extends ContentEntityBase implements ImageInterface {
return $this->get('image_id')->value;
}
/**
* {@inheritdoc}
*/
public function setImageId($image_id = '') {
return $this->set('image_id', $image_id);
}
/**
* {@inheritdoc}
*/
......
<?php
// 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/25
......@@ -95,6 +97,7 @@ class ImageCreateForm extends CloudContentForm {
));
if (isset($result['ImageId'])
&& ($entity->setImageId($result['ImageId']))
&& ($entity->save())) {
$status = 'status';
......
......@@ -5,6 +5,7 @@
* Contains \Drupal\aws_cloud\Form\Ec2\InstanceDeleteForm.
*/
// Updated by yas 2016/06/12
// Updated by yas 2016/05/31
// Updated by yas 2016/05/30
// updated by yas 2016/05/29
......@@ -40,7 +41,9 @@ class InstanceDeleteForm extends CloudContentDeleteForm {
'@type' => $entity->getEntityType()->getLabel(),
'@label' => $entity->label(),
]);
if($apiController->terminateInstance($entity)) {
$result = $apiController->terminateInstance($entity);
if(isset($result[0]['InstanceId'])) {
$status = 'status';
$message = $this->t('The @type "@label" has been terminated.', [
......
......@@ -77,7 +77,7 @@ class ImageTest extends WebTestBase {
$this->assertNoText(t('Notice'), t('List | ake sure w/o Notice'));
$this->assertNoText(t('warning'), t('List | Make sure w/o Warnings'));
// Launch a new Image.
// Register a new Image.
$add = $this->createImageTestData();
// 3 times.
for ($i = 0; $i < AWS_CLOUD_IMAGE_REPEAT_COUNT; $i++) {
......
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