Skip to content
Snippets Groups Projects
Commit c3bf6b8d authored by Ryo Yamashita's avatar Ryo Yamashita Committed by Yas Naoi
Browse files

Issue #3308275 by Ryo Yamashita, yas: Add the function to launch OpenStack Instance in the SPA

parent 434f819f
No related branches found
No related tags found
No related merge requests found
......@@ -3,7 +3,7 @@
namespace Drupal\openstack\Form;
use Drupal\aws_cloud\Form\Ec2\InstanceLaunchForm;
use Drupal\openstack\Entity\Config\Config;
use Drupal\cloud\Entity\CloudConfig;
use Drupal\Core\Form\FormStateInterface;
/**
......@@ -31,8 +31,7 @@ class OpenStackInstanceLaunchForm extends InstanceLaunchForm {
*/
public function buildForm(array $form, FormStateInterface $form_state, $cloud_context = ''): array {
// @FIXME: Maybe this is a bug.
$cloudContext = Config::load($cloud_context);
$cloudContext = CloudConfig::load($cloud_context);
if (isset($cloudContext)) {
$this->ec2Service->setCloudContext($cloudContext->getCloudContext());
......@@ -43,8 +42,8 @@ class OpenStackInstanceLaunchForm extends InstanceLaunchForm {
]));
}
/** @var \Drupal\openstack\Entity\Instance $entity */
$form = parent::buildForm($form, $form_state);
/** @var \Drupal\openstack\Entity\InstanceInterface $entity */
$entity = $this->entity;
$form['key_pair_name'] = [
......
......@@ -615,7 +615,7 @@ class OpenStackOperationsService implements OpenStackOperationsServiceInterface
usort($form_tags, static function ($a, $b) {
return (int) $a['_weight'] - (int) $b['_weight'];
});
/** @var \Drupal\openstack\Service\OpenStackServiceInterface */
/** @var \Drupal\openstack\Service\OpenStackServiceInterface|\Drupal\cloud\Service\CloudResourceTagInterface $ec2_service */
$ec2_service = $this->openStackServiceFactory->get($entity->getCloudContext());
$this->ec2Service = $ec2_service;
$uid_key_name = $ec2_service->getTagKeyCreatedByUid(
......
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