Comments

jigish.addweb created an issue. See original summary.

jigish.addweb’s picture

Status: Active » Needs review
StatusFileSize
new32.14 KB
yas’s picture

Status: Needs review » Needs work

@jigishaddweb

Thank you for the refactoring. The patch looks good, but I found db_drop_table() is depreciated in openstack.install. Could you please also refactor them?

yas’s picture

yas’s picture

@jigishaddweb

I found the following warning and error while running drush updb -y

// Do you wish to run the specified pending updates?: yes.

>  [notice] Update started: k8s_update_8264
>  [notice] Update completed: k8s_update_8264
>  [notice] Update started: k8s_update_8265
>  [notice] Update completed: k8s_update_8265
>  [notice] Update started: k8s_update_8266
>  [notice] Update completed: k8s_update_8266
>  [notice] Update started: k8s_update_8267
>  [notice] Update completed: k8s_update_8267
>  [notice] Update started: k8s_update_8268
>  [notice] Update completed: k8s_update_8268
>  [notice] Update started: k8s_update_8269
>  [notice] Update completed: k8s_update_8269
>  [notice] Update started: k8s_update_8270
>  [notice] Update completed: k8s_update_8270
>  [notice] Update started: k8s_update_8271
>  [notice] Update completed: k8s_update_8271
>  [notice] Update started: k8s_update_8272
>  [notice] Update completed: k8s_update_8272
>  [notice] Update started: aws_cloud_update_8197
>  [notice] Update completed: aws_cloud_update_8197
>  [notice] Update started: aws_cloud_update_8198
>  [notice] Update completed: aws_cloud_update_8198
>  [notice] Update started: aws_cloud_update_8199
>  [notice] Update completed: aws_cloud_update_8199
>  [notice] Update started: aws_cloud_update_8200
>  [notice] Update completed: aws_cloud_update_8200
>  [notice] Update started: aws_cloud_update_8201
>  [notice] Update completed: aws_cloud_update_8201
>  [notice] Update started: aws_cloud_update_8202
>  [notice] Update completed: aws_cloud_update_8202
>  [notice] Update started: aws_cloud_update_8203
>  [notice] Update completed: aws_cloud_update_8203
>  [notice] Update started: aws_cloud_update_8204
>  [notice] Update completed: aws_cloud_update_8204
>  [notice] Update started: aws_cloud_update_8205
>  [notice] Update completed: aws_cloud_update_8205
>  [notice] Update started: aws_cloud_update_8206
>  [notice] Update completed: aws_cloud_update_8206
>  [notice] Update started: aws_cloud_update_8207
>  [notice] Update completed: aws_cloud_update_8207
>  [notice] Update started: aws_cloud_update_8208
>  [notice] Update completed: aws_cloud_update_8208
>  [notice] Update started: cloud_update_8127
>  [notice] Update completed: cloud_update_8127
>  [notice] Update started: cloud_update_8128
>  [notice] Update completed: cloud_update_8128
>  [notice] Update started: k8s_update_8273
>  [notice] Update completed: k8s_update_8273
>  [notice] Update started: cloud_update_8129
>  [notice] Update completed: cloud_update_8129
>  [notice] Update started: openstack_update_8202
>  [warning] file_get_contents(/var/www/html/web/modules/contrib/cloud/modules/cloud_service_providers/openstack/config/install/views.view.openstack_cloud_instance.yml): failed to open stream: No such file or directory cloud.module:327
>  [notice] Update completed: openstack_update_8202
>  [notice] Update started: cloud_update_8130
>  [notice] Update completed: cloud_update_8130
>  [notice] Update started: openstack_update_8203
>  [error]  The "openstack_cloud_image" entity type does not exist. 
>  [error]  Update failed: openstack_update_8203 
>  [notice] Update started: k8s_update_8274
>  [notice] Update completed: k8s_update_8274
>  [notice] Update started: cloud_update_8131
>  [notice] Update completed: cloud_update_8131
>  [notice] Update started: aws_cloud_update_8209
>  [notice] Update completed: aws_cloud_update_8209
>  [notice] Update started: aws_cloud_update_8210
>  [notice] Update completed: aws_cloud_update_8210
>  [notice] Update started: aws_cloud_update_8211
>  [notice] Update completed: aws_cloud_update_8211
>  [notice] Update started: aws_cloud_update_8212
>  [notice] Update completed: aws_cloud_update_8212
>  [notice] Update started: aws_cloud_update_8213
>  [notice] Update completed: aws_cloud_update_8213
>  [notice] Update started: aws_cloud_update_8214
>  [notice] Update completed: aws_cloud_update_8214
>  [notice] Update started: aws_cloud_update_8215
>  [notice] Update completed: aws_cloud_update_8215
>  [notice] Update started: aws_cloud_update_8216
>  [notice] Update completed: aws_cloud_update_8216
>  [notice] Update started: aws_cloud_update_8217
>  [notice] Update completed: aws_cloud_update_8217
>  [notice] Update started: aws_cloud_update_8218
>  [notice] Update completed: aws_cloud_update_8218
>  [notice] Update started: aws_cloud_update_8219
>  [notice] Update completed: aws_cloud_update_8219
>  [notice] Update started: system_update_8901
>  [notice] Update completed: system_update_8901
 [error]  Update aborted by: openstack_update_8203 
 [error]  Finished performing updates. 
jigish.addweb’s picture

Status: Needs work » Needs review
StatusFileSize
new39.84 KB
new7.99 KB

@yas

Thank you for reviewing the patch.

I refactored db_drop_table() function and fixed warning.

Please test updated patch.

Thanks

yas’s picture

Status: Needs review » Needs work

@jigishaddweb

Thank you for fixing it. It looks beautiful, but could you please fix the following coding violation?

$ phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md /var/www/html/web/modules/contrib/cloud/

FILE: /var/www/html/web/modules/contrib/cloud/modules/cloud_service_providers/openstack/openstack.install
---------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------
 415 | ERROR | [x] Expected 1 space after FOREACH keyword; 0 found
---------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------
yas’s picture

@jigishaddweb

One more thing, could you please move the following code in between openstack_uninstall and openstack_update_8201?

/**
 * Add entity type.
 */
function openstack_add_entity_type($entity_id) {
  // Add entity type.
  $definition_update_manager = \Drupal::entityDefinitionUpdateManager();
  $entity_type = \Drupal::entityTypeManager()->getDefinition($entity_id);
  $definition_update_manager->uninstallEntityType($entity_type);
  $definition_update_manager->installEntityType($entity_type);
} 
  
/**
 * Drop database table.
 */
function openstack_drop_db_table($tables) {
  $schema = Database::getConnection()->schema();
  foreach($tables as $table) {
    $schema->dropTable($table);
  }
}
jigish.addweb’s picture

Status: Needs work » Needs review
StatusFileSize
new40.41 KB
new1.57 KB

@yas

Fixed coding standard violations and moved the above code.

Please test new patch.

Thanks

yas’s picture

Status: Needs review » Reviewed & tested by the community

@jigishaddweb

Thank you for fixing and the refactoring. It looks good to me now. I'll merge the patch to 8.x-1.x and 8.x-2.x and close this issue as Fixed.

  • yas committed 01c0e8e on 8.x-1.x authored by jigish.addweb
    Issue #3121336 by jigish.addweb, yas: Refactor OpenStack image listing
    

  • yas committed 9d68043 on 8.x-2.x authored by jigish.addweb
    Issue #3121336 by jigish.addweb, yas: Refactor OpenStack image listing
    
yas’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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