Skip to content

Commit

Permalink
Merge pull request #19970 from gmcculloug/rconfigure_task_display_name
Browse files Browse the repository at this point in the history
Rename private display_name method to avoid conflict

(cherry picked from commit 2c5c59f)
  • Loading branch information
Fryguy authored and simaishi committed Mar 20, 2020
1 parent 775f6bb commit 5a08a2a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/models/vm_reconfigure_task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def self.get_description(req)
msg << build_message(options, :network_adapter_edit, "Edit Network Adapters: %d", :length)
msg << build_message(options, :cdrom_connect, "Attach CD/DVDs: %d", :length)
msg << build_message(options, :cdrom_disconnect, "Detach CD/DVDs: %d", :length)
"#{request_class::TASK_DESCRIPTION} for: #{display_name(req)} - #{msg.compact.join(", ")}"
"#{request_class::TASK_DESCRIPTION} for: #{resource_name(req)} - #{msg.compact.join(", ")}"
end

def self.build_message(options, key, message, modifier = nil)
Expand All @@ -45,15 +45,15 @@ def self.build_disk_message(options)
end
private_class_method :build_disk_message

def self.display_name(req)
def self.resource_name(req)
return req.source.name if req.source
return "Multiple VMs" if req.options[:src_ids].length > 1

# Single source has not been selected yet
vm = Vm.find_by(:id => req.options[:src_ids])
vm.nil? ? "" : vm.name
end
private_class_method :display_name
private_class_method :resource_name

def after_request_task_create
update_attribute(:description, get_description)
Expand Down

0 comments on commit 5a08a2a

Please sign in to comment.