Skip to content

Commit

Permalink
Merge pull request #19077 from yaacov/do-not-get-stuck-on-destroy
Browse files Browse the repository at this point in the history
Do not get stuck on destroy

(cherry picked from commit 2375092)

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1763857
  • Loading branch information
agrare authored and simaishi committed Oct 21, 2019
1 parent a0099cc commit 1b32f43
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/models/ext_management_system.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 1b32f43

Please sign in to comment.