Loading modules/cloud_service_providers/openstack/src/Form/OpenStackSecurityGroupCreateForm.php +4 −0 Original line number Diff line number Diff line Loading @@ -181,6 +181,10 @@ class OpenStackSecurityGroupCreateForm extends SecurityGroupCreateForm { $this->ec2Service = $this->openStackServiceFactory->get($entity->getCloudContext()); parent::save($form, $form_state); if (!empty($result['SendToWorker'])) { return; } if ($this->ec2Service instanceof OpenStackRestService) { $this->updateNameAndCreatedByTags($entity, $entity->getGroupId()); } Loading modules/cloud_service_providers/openstack/src/Service/OpenStackRestServiceMock.php +3 −3 Original line number Diff line number Diff line Loading @@ -452,10 +452,10 @@ class OpenStackRestServiceMock extends OpenStackService { * @param array $params * Parameters to pass to the API. * * @return array * @return array|null * Succeeded or failed. */ public function deleteSecurityGroup(array $params = []): array { public function deleteSecurityGroup(array $params = []): ?array { return $this->getMockData(__FUNCTION__); } Loading modules/cloud_service_providers/openstack/src/Service/Rest/OpenStackService.php +26 −5 Original line number Diff line number Diff line Loading @@ -1906,7 +1906,13 @@ class OpenStackService extends CloudServiceBase implements OpenStackServiceInter * @return array * The security group create API response. */ public function createSecurityGroup(array $params = []) { public function createSecurityGroup(array $params = []): array { if ($this->isWorkerResource()) { $this->saveOperation(__FUNCTION__, [$params], 'updateSecurityGroups'); return ['SendToWorker' => TRUE]; } $this->loadCredentials(); $project_id = $this->credentials['project_id']; Loading Loading @@ -1945,7 +1951,13 @@ class OpenStackService extends CloudServiceBase implements OpenStackServiceInter * @return array * The security group update API response. */ public function updateSecurityGroup(array $params = []) { public function updateSecurityGroup(array $params = []): array { if ($this->isWorkerResource()) { $this->saveOperation(__FUNCTION__, [$params], 'updateSecurityGroups'); return ['SendToWorker' => TRUE]; } $this->loadCredentials(); $project_id = $this->credentials['project_id']; Loading Loading @@ -1980,10 +1992,16 @@ class OpenStackService extends CloudServiceBase implements OpenStackServiceInter * @param array $params * Parameters to pass to the API. * * @return bool * @return array|null * Succeeded or failed. */ public function deleteSecurityGroup(array $params = []) { public function deleteSecurityGroup(array $params = []): ?array { if ($this->isWorkerResource()) { $this->saveOperation(__FUNCTION__, [$params], 'updateSecurityGroups'); return ['SendToWorker' => TRUE]; } $this->loadCredentials(); $credentials = [ Loading @@ -1993,7 +2011,7 @@ class OpenStackService extends CloudServiceBase implements OpenStackServiceInter $response = $this->getClient($credentials); return $response['status_code'] === 204; return $response['status_code'] === 204 ? ['Success' => TRUE] : NULL; } /** Loading Loading @@ -3242,6 +3260,9 @@ class OpenStackService extends CloudServiceBase implements OpenStackServiceInter * indicates success so failure. */ public function updateSecurityGroupEntities(array $params = [], $clear = TRUE, $entity_type = '', $cloud_context = '', $update = TRUE): bool { if ($this->isWorkerResource()) { return TRUE; } $cloud_config = $this->entityTypeManager ->getStorage('cloud_config') Loading Loading
modules/cloud_service_providers/openstack/src/Form/OpenStackSecurityGroupCreateForm.php +4 −0 Original line number Diff line number Diff line Loading @@ -181,6 +181,10 @@ class OpenStackSecurityGroupCreateForm extends SecurityGroupCreateForm { $this->ec2Service = $this->openStackServiceFactory->get($entity->getCloudContext()); parent::save($form, $form_state); if (!empty($result['SendToWorker'])) { return; } if ($this->ec2Service instanceof OpenStackRestService) { $this->updateNameAndCreatedByTags($entity, $entity->getGroupId()); } Loading
modules/cloud_service_providers/openstack/src/Service/OpenStackRestServiceMock.php +3 −3 Original line number Diff line number Diff line Loading @@ -452,10 +452,10 @@ class OpenStackRestServiceMock extends OpenStackService { * @param array $params * Parameters to pass to the API. * * @return array * @return array|null * Succeeded or failed. */ public function deleteSecurityGroup(array $params = []): array { public function deleteSecurityGroup(array $params = []): ?array { return $this->getMockData(__FUNCTION__); } Loading
modules/cloud_service_providers/openstack/src/Service/Rest/OpenStackService.php +26 −5 Original line number Diff line number Diff line Loading @@ -1906,7 +1906,13 @@ class OpenStackService extends CloudServiceBase implements OpenStackServiceInter * @return array * The security group create API response. */ public function createSecurityGroup(array $params = []) { public function createSecurityGroup(array $params = []): array { if ($this->isWorkerResource()) { $this->saveOperation(__FUNCTION__, [$params], 'updateSecurityGroups'); return ['SendToWorker' => TRUE]; } $this->loadCredentials(); $project_id = $this->credentials['project_id']; Loading Loading @@ -1945,7 +1951,13 @@ class OpenStackService extends CloudServiceBase implements OpenStackServiceInter * @return array * The security group update API response. */ public function updateSecurityGroup(array $params = []) { public function updateSecurityGroup(array $params = []): array { if ($this->isWorkerResource()) { $this->saveOperation(__FUNCTION__, [$params], 'updateSecurityGroups'); return ['SendToWorker' => TRUE]; } $this->loadCredentials(); $project_id = $this->credentials['project_id']; Loading Loading @@ -1980,10 +1992,16 @@ class OpenStackService extends CloudServiceBase implements OpenStackServiceInter * @param array $params * Parameters to pass to the API. * * @return bool * @return array|null * Succeeded or failed. */ public function deleteSecurityGroup(array $params = []) { public function deleteSecurityGroup(array $params = []): ?array { if ($this->isWorkerResource()) { $this->saveOperation(__FUNCTION__, [$params], 'updateSecurityGroups'); return ['SendToWorker' => TRUE]; } $this->loadCredentials(); $credentials = [ Loading @@ -1993,7 +2011,7 @@ class OpenStackService extends CloudServiceBase implements OpenStackServiceInter $response = $this->getClient($credentials); return $response['status_code'] === 204; return $response['status_code'] === 204 ? ['Success' => TRUE] : NULL; } /** Loading Loading @@ -3242,6 +3260,9 @@ class OpenStackService extends CloudServiceBase implements OpenStackServiceInter * indicates success so failure. */ public function updateSecurityGroupEntities(array $params = [], $clear = TRUE, $entity_type = '', $cloud_context = '', $update = TRUE): bool { if ($this->isWorkerResource()) { return TRUE; } $cloud_config = $this->entityTypeManager ->getStorage('cloud_config') Loading