app/models/foreman_tasks/lock.rb in foreman-tasks-0.6.4 vs app/models/foreman_tasks/lock.rb in foreman-tasks-0.6.5
- old
+ new
@@ -11,16 +11,17 @@
RESERVED_LOCK_NAMES = [LINK_LOCK_NAME, OWNER_LOCK_NAME, ALL_LOCK_NAME]
class LockConflict < StandardError
attr_reader :required_lock, :conflicting_locks
def initialize(required_lock, conflicting_locks)
- header = <<-TXT.gsub(/^ *\|/, '')
- |Required lock is already taken by other running tasks.
- |Please inspect their state, fix their errors nad resume them.
- |
- |Required lock: #{required_lock.name}
- |Conflicts with tasks:
- TXT
+ header = _("Required lock is already taken by other running tasks.")
+ header << "\n"
+ header << _("Please inspect their state, fix their errors and resume them.")
+ header << "\n\n"
+ header << _("Required lock: %s") % required_lock.name
+ header << "\n"
+ header << _("Conflicts with tasks:")
+ header << "\n"
url_helpers = Rails.application.routes.url_helpers
conflicting_tasks = conflicting_locks.
map(&:task).
uniq.
map { |task| "- #{Setting['foreman_url'] + url_helpers.foreman_tasks_task_path(task)}" }.