Comments

Ishani.addweb created an issue. See original summary.

ishani.addweb’s picture

Status: Active » Needs review
StatusFileSize
new80.57 KB
baldwinlouie’s picture

Status: Needs review » Needs work

@ishani, Thank you for this patch. I have the following comments.

  1. +++ b/modules/cloud_service_providers/openstack/src/Form/OpenStackInstanceEditForm.php
    @@ -0,0 +1,145 @@
    +class OpenStackInstanceEditForm extends InstanceEditForm {
    ...
    +    $openStackEc2Service = \Drupal::service('openstack.ec2');
    

    Please add a
    public static function create(ContainerInterface $container) to pass the openstack.ec2 service to this form.

    See OpenStackSnapshotCreateForm.php for reference.

  2. +++ b/modules/cloud_service_providers/openstack/src/Form/OpenStackInstanceEditForm.php
    @@ -0,0 +1,145 @@
    +    unset($form['instance']['instance_type']);
    +    unset($form['instance']['iam_role']);
    +    unset($form['network']['security_groups']);
    +    unset($form['options']['schedule']);
    +    unset($form['options']['user_data']);
    

    Instead of unsetting these form elements, it is better to set ['#access'] = FALSE;

    For example:
    $form['instance']['instance_type']['#access'] = FALSE;

    See this explanation: https://drupal.stackexchange.com/questions/17778/unset-form-elements-wit...

  3. +++ b/modules/cloud_service_providers/openstack/src/Form/OpenStackInstanceEditForm.php
    @@ -0,0 +1,145 @@
    +    $openStackEc2Service = \Drupal::service('openstack.ec2');
    

    Please use the $ec2Service object that is dependency injected.

  4. +++ b/modules/cloud_service_providers/openstack/src/Form/OpenStackInstanceEditForm.php
    @@ -0,0 +1,145 @@
    +    $openStackEc2Service = \Drupal::service('openstack.ec2');
    

    Please use the $ec2Service object that is dependency injected.

ishani.addweb’s picture

Status: Needs work » Needs review
StatusFileSize
new80.46 KB

@baldwinlouie
Please ignore above patch
Thanks.

ishani.addweb’s picture

StatusFileSize
new79.78 KB

@baldwinlouie @yas
Done changes as per your above comment.
Interdiff of patch is not provided as having conflicts in file.
Please review new patch.

Thanks.

yas’s picture

Status: Needs review » Needs work

@ishaniaddweb

I got an Internal Server Error and received the following error at http://example.com/clouds/openstack/dii_regionone/instance?q=clouds%2Fopenstack%2Fdii_regionone%2Finstance

Could you please check it?

Drupal\Core\Database\DatabaseExceptionWrapper: Exception in OpenStack Instance[openstack_instance]: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'dev2.openstack_instance__network_interfaces' doesn't exist: SELECT t.* FROM {openstack_instance__network_interfaces} t WHERE (entity_id IN (:db_condition_placeholder_0, :db_condition_placeholder_1, :db_condition_placeholder_2, :db_condition_placeholder_3)) AND (deleted = :db_condition_placeholder_4) AND (langcode IN (:db_condition_placeholder_5, :db_condition_placeholder_6, :db_condition_placeholder_7)) ORDER BY delta ASC; Array ( [:db_condition_placeholder_0] => 1 [:db_condition_placeholder_1] => 2 [:db_condition_placeholder_2] => 3 [:db_condition_placeholder_3] => 4 [:db_condition_placeholder_4] => 0 [:db_condition_placeholder_5] => en [:db_condition_placeholder_6] => und [:db_condition_placeholder_7] => zxx ) in Drupal\views\Plugin\views\query\Sql->execute() (line 1543 of /var/www/html/web/core/modules/views/src/Plugin/views/query/Sql.php).

ishani.addweb’s picture

jigish.addweb’s picture

Status: Needs work » Needs review
StatusFileSize
new80.05 KB

@yas

I fixed database error as you reported.

Please test new patch.

Thanks

yas’s picture

@jigishaddweb

All tests have not been passed successfully:

6291.png
6292.png

jigish.addweb’s picture

Status: Needs work » Needs review
StatusFileSize
new84.91 KB
new6.24 KB

@yas

Thank you for testing the patch.

I fixed AWS testcase errors. Please review new patch.

Thanks

yas’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new1.1 MB
new4.01 MB

@jigishaddweb

Thank you for the update. I tested and I think this is a great patch.

7475.png

pipelines.png

@baldwinlouie

Could you please review the patch just in case?

yas’s picture

Status: Reviewed & tested by the community » Needs review
baldwinlouie’s picture

Status: Needs review » Needs work

@jigish, and @yas, Thank you for the patch. It looks pretty good. I have the following two comments.

  1. +++ b/modules/cloud_service_providers/openstack/openstack.install
    @@ -595,6 +595,23 @@ function openstack_update_8226() {
    +function openstack_update_8227() {
    

    Can you please delete the old module/cloud_service_providers/openstack/Entity/Instance "Instance" entity from the database?

    Please look at aws_cloud_update_8218() for an example of deleting the 'aws_cloud_vpc_peering_connection' entity.

  2. +++ b/modules/cloud_service_providers/openstack/src/Entity/OpenStackInstance.php
    @@ -0,0 +1,53 @@
    + *   label = @Translation("OpenStack Instance"),
    

    Can you please add the following three annotations?

     *   id_plural = "openstack_instances",
     *   label_singular = @Translation("Instance"),
     *   label_plural = @Translation("Instances"),
    
jigish.addweb’s picture

Status: Needs work » Needs review
StatusFileSize
new86.26 KB
new2.71 KB

@yas @baldwinlouie

Thank you for reviewing the patch.

I changed the code as per above comment.

Please review the new patch.

Thanks

yas’s picture

Status: Needs review » Needs work

@jigishaddweb

Thank you for the update. The following code is a part of openstack_update_8227 but could you please add ?: [] just in case? That is, foreach ($entities ?: [] as $entity) { because if we search the entire code, it will let us pay attention.

<?php
+++ b/modules/cloud_service_providers/openstack/openstack.install

@@ -601,15 +603,31 @@
* Update openstack_instance view.
*/
function openstack_update_8227() {
...

+ foreach ($entities as $entity) {

jigish.addweb’s picture

Status: Needs work » Needs review
StatusFileSize
new86.26 KB
new736 bytes

@yas

Thank you for review the patch.

I have done the changes as you mentioned in previous comment.

Please review the updated patch again.

Thanks

yas’s picture

@jigishaddweb

Thank you for the update!

@baldwinlouie

Could you please review the patch?

baldwinlouie’s picture

Status: Needs review » Reviewed & tested by the community

@yas and @jigish, Thank you for the update. The patch looks good to me now.

yas’s picture

@baldwinlouie

Thank you for your review. I'll merge the patch to 8.x-1.x and 8.x-2.x and close this issue as Fixed.

  • yas committed 4354fe9 on 8.x-1.x authored by jigish.addweb
    Issue #3123791 by jigish.addweb, Ishani.addweb, yas, baldwinlouie:...

  • yas committed a0d316d on 8.x-2.x authored by jigish.addweb
    Issue #3123791 by jigish.addweb, Ishani.addweb, yas, baldwinlouie:...
yas’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.