Skip to content

Commit

Permalink
Merge pull request #7639 from agrare/replace_host_validate_destroy_wi…
Browse files Browse the repository at this point in the history
…th_supports_feature

Replace Host.validate_destroy with supports feature
  • Loading branch information
chessbyte authored Feb 24, 2021
2 parents e959d77 + 912ad58 commit 54cc0a5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions app/controllers/mixins/actions/host_actions/misc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@ def process_hosts_refresh(hosts, task, display_name)

def process_hosts_destroy(hosts, display_name)
each_host(hosts, display_name) do |host|
validation = host.validate_destroy
if !validation[:available]
add_flash(validation[:message], :error)
if !host.supports?(:destroy)
add_flash(host.unsupported_reason(:destroy), :error)
else
audit = {:event => "host_record_delete_initiated",
:message => "[#{host.name}] Record delete initiated",
Expand Down

0 comments on commit 54cc0a5

Please sign in to comment.