dtlpy 1.104.14__py3-none-any.whl → 1.106.5__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -282,6 +282,11 @@ def after_tag(context, tag):
282
282
  use_fixture(restore_json_file, context)
283
283
  except Exception:
284
284
  logging.exception('Failed to restore json file')
285
+ elif tag == 'compute_serviceDriver.delete':
286
+ try:
287
+ use_fixture(delete_compute_servicedriver, context)
288
+ except Exception:
289
+ logging.exception('Failed to delete service')
285
290
  elif tag == 'frozen_dataset':
286
291
  pass
287
292
  elif 'testrail-C' in tag:
@@ -504,7 +509,36 @@ def models_delete(context):
504
509
  assert all_deleted
505
510
 
506
511
 
512
+ def delete_compute_servicedriver(context):
513
+ if not hasattr(context, 'to_delete_computes_ids') and not hasattr(context, 'to_delete_service_drivers_ids'):
514
+ return
515
+
516
+ all_deleted = True
517
+ for service_driver_id in context.to_delete_service_drivers_ids:
518
+ try:
519
+ context.dl.service_drivers.delete(service_driver_id=service_driver_id)
520
+ except context.dl.exceptions.NotFound:
521
+ pass
522
+ except:
523
+ all_deleted = False
524
+ logging.exception('Failed deleting serviceDriver: {}'.format(service_driver_id))
525
+ assert all_deleted
526
+
527
+ all_deleted = True
528
+ for compute_id in context.to_delete_computes_ids:
529
+ try:
530
+ context.dl.computes.delete(compute_id=compute_id)
531
+ except context.dl.exceptions.NotFound:
532
+ pass
533
+ except:
534
+ all_deleted = False
535
+ logging.exception('Failed deleting compute: {}'.format(compute_id))
536
+ assert all_deleted
537
+
538
+
507
539
  def restore_json_file(context):
540
+ if not hasattr(context.feature, 'dataloop_feature_project'):
541
+ return
508
542
  if not hasattr(context, 'backup_path') or not hasattr(context, 'original_path'):
509
543
  assert False, 'Please make sure to set the original_path and backup_path in the context'
510
544
  # Restore the file from the backup
File without changes