From 449522d7a70cf5cc7eda82598ab8279011c4c459 Mon Sep 17 00:00:00 2001 From: Greg McCullough Date: Wed, 28 Nov 2018 14:04:56 -0500 Subject: [PATCH] Merge pull request #272 from agrare/disconnect_storage_no_op Make disconnect_storage a no-op (cherry picked from commit d9dcef8ce15f9b51766bed4ef65c41397a900122) https://bugzilla.redhat.com/show_bug.cgi?id=1644770 --- .../engine/miq_ae_engine/miq_ae_builtin_method.rb | 5 +++-- .../service_models/miq_ae_service_ems_event.rb | 3 ++- spec/service_models/miq_ae_service_ems_event_spec.rb | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/miq_automation_engine/engine/miq_ae_engine/miq_ae_builtin_method.rb b/lib/miq_automation_engine/engine/miq_ae_engine/miq_ae_builtin_method.rb index 9b5147213..e511c628f 100644 --- a/lib/miq_automation_engine/engine/miq_ae_engine/miq_ae_builtin_method.rb +++ b/lib/miq_automation_engine/engine/miq_ae_engine/miq_ae_builtin_method.rb @@ -142,8 +142,9 @@ def self.miq_src_vm_destroy_all_snapshots(obj, _inputs) event_object_from_workspace(obj).src_vm_destroy_all_snapshots end - def self.miq_src_vm_disconnect_storage(obj, _inputs) - event_object_from_workspace(obj).src_vm_disconnect_storage + def self.miq_src_vm_disconnect_storage(_obj, _inputs) + # Logic for storage disconnect has been moved to VmOrTemplate#disconnect_inv + # This method is kept for compatibility and will be removed in a future version end def self.miq_event_enforce_policy(obj, _inputs) diff --git a/lib/miq_automation_engine/service_models/miq_ae_service_ems_event.rb b/lib/miq_automation_engine/service_models/miq_ae_service_ems_event.rb index 84e6171ce..1d0f7b9dc 100644 --- a/lib/miq_automation_engine/service_models/miq_ae_service_ems_event.rb +++ b/lib/miq_automation_engine/service_models/miq_ae_service_ems_event.rb @@ -33,7 +33,8 @@ def src_vm_destroy_all_snapshots end def src_vm_disconnect_storage - ar_method { @object.src_vm_disconnect_storage } + # Logic for storage disconnect has been moved to VmOrTemplate#disconnect_inv + # This method is kept for compatibility and will be removed in a future version end end end diff --git a/spec/service_models/miq_ae_service_ems_event_spec.rb b/spec/service_models/miq_ae_service_ems_event_spec.rb index b765a59e8..f5312196f 100644 --- a/spec/service_models/miq_ae_service_ems_event_spec.rb +++ b/spec/service_models/miq_ae_service_ems_event_spec.rb @@ -177,7 +177,7 @@ end it "#src_vm_disconnect_storage" do - expect_any_instance_of(VmOrTemplate).to receive("disconnect_storage".to_sym).once + expect_any_instance_of(VmOrTemplate).not_to receive("disconnect_storage".to_sym).once @service_event.src_vm_disconnect_storage end end