diff --git a/app/models/ext_management_system.rb b/app/models/ext_management_system.rb index 50da7be130f..717511d8085 100644 --- a/app/models/ext_management_system.rb +++ b/app/models/ext_management_system.rb @@ -458,9 +458,10 @@ def self.ems_physical_infra_discovery_types @ems_physical_infra_discovery_types ||= %w(lenovo_ph_infra) end - def disable! + def disable!(validate: true) _log.info("Disabling EMS [#{name}] id [#{id}].") - update!(:enabled => false) + self.enabled = false + save(:validate => validate) end def enable! @@ -488,7 +489,7 @@ def destroy_queue end def destroy(task_id = nil) - disable! if enabled? + disable!(:validate => false) if enabled? _log.info("Destroying #{child_managers.count} child_managers") child_managers.destroy_all