Skip to content
Snippets Groups Projects

Issue #3266542 by Xiaohua Guan, yas: Create entity type availability zone (OpenStack)

Merged Issue #3266542 by Xiaohua Guan, yas: Create entity type availability zone (OpenStack)
Merged xiaohua guan requested to merge issue/cloud-3266542:3266542-create-entity-type into 5.x
Files
10
@@ -5,7 +5,6 @@ namespace Drupal\aws_cloud\Form\Ec2;
use Drupal\aws_cloud\Traits\AwsCloudFormTrait;
use Drupal\cloud\Traits\CloudContentEntityTrait;
use Drupal\Core\Form\FormStateInterface;
use Drupal\openstack\Entity\OpenStackVolume;
/**
* Form controller for the Volume entity create form.
@@ -120,11 +119,10 @@ class VolumeCreateForm extends AwsCloudContentForm {
'#required' => FALSE,
];
// @FIXME: We can remove the following code once we introduce
// AvailabilityZone entity for OpenStack.
$availability_zone_options = $entity instanceof OpenStackVolume
? $this->ec2Service->getAvailabilityZones()
: $this->getAvailabilityZoneOptions($cloud_context);
// Get module name.
$module_name = $this->getModuleName($entity);
$availability_zone_options = $this->getAvailabilityZoneOptions($cloud_context, $module_name);
$form['volume']['availability_zone'] = [
'#type' => 'select',
Loading