app/models/foreman_tasks/lock.rb in foreman-tasks-0.10.8 vs app/models/foreman_tasks/lock.rb in foreman-tasks-0.10.9

- old
+ new

@@ -10,17 +10,16 @@ RESERVED_LOCK_NAMES = [LINK_LOCK_NAME, OWNER_LOCK_NAME, ALL_LOCK_NAME].freeze class LockConflict < StandardError attr_reader :required_lock, :conflicting_locks def initialize(required_lock, conflicting_locks) - 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" + header = <<-HEADER.gsub(/^\s+\| ?/, '') + | #{_('Required lock is already taken by other running tasks.')} + | #{_('Please inspect their state, fix their errors and resume them.')} + | + | #{_('Required lock: %s') % required_lock.name} + | #{_('Conflicts with tasks:')} + HEADER 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)}" }