Sha256: de7da45a87b7ba2f723c45ed37df4b31ac5724c0eed04bf80b386d99755f8194

Contents?: true

Size: 683 Bytes

Versions: 29

Compression:

Stored size: 683 Bytes

Contents

module Actions
  module Helpers
    module Lock
      def task
        ::ForemanTasks::Task::DynflowTask.find_by_external_id!(execution_plan_id)
      end

      # @see Lock.exclusive!
      def exclusive_lock!(resource)
        phase! Dynflow::Action::Plan
        ::ForemanTasks::Lock.exclusive!(resource, task.id)
      end

      # @see Lock.lock!
      def lock!(resource, *lock_names)
        phase! Dynflow::Action::Plan
        ::ForemanTasks::Lock.lock!(resource, task.id, *lock_names.flatten)
      end

      # @see Lock.link!
      def link!(resource)
        phase! Dynflow::Action::Plan
        ::ForemanTasks::Lock.link!(resource, task.id)
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
foreman-tasks-0.6.9 app/lib/actions/helpers/lock.rb
foreman-tasks-0.6.8 app/lib/actions/helpers/lock.rb
foreman-tasks-0.6.7 app/lib/actions/helpers/lock.rb
foreman-tasks-0.6.6 app/lib/actions/helpers/lock.rb
foreman-tasks-0.6.5 app/lib/actions/helpers/lock.rb
foreman-tasks-0.6.4 app/lib/actions/helpers/lock.rb
foreman-tasks-0.6.3 app/lib/actions/helpers/lock.rb
foreman-tasks-0.6.2 app/lib/actions/helpers/lock.rb
foreman-tasks-0.6.1 app/lib/actions/helpers/lock.rb
foreman-tasks-0.6.0 app/lib/actions/helpers/lock.rb
foreman-tasks-0.5.7 app/lib/actions/helpers/lock.rb
foreman-tasks-0.5.6 app/lib/actions/helpers/lock.rb
foreman-tasks-0.5.5 app/lib/actions/helpers/lock.rb
foreman-tasks-0.5.4 app/lib/actions/helpers/lock.rb
foreman-tasks-0.5.3 app/lib/actions/helpers/lock.rb
foreman-tasks-0.5.2 app/lib/actions/helpers/lock.rb
foreman-tasks-0.5.1 app/lib/actions/helpers/lock.rb
foreman-tasks-0.5.0 app/lib/actions/helpers/lock.rb
foreman-tasks-0.4.0 app/lib/actions/helpers/lock.rb
foreman-tasks-0.3.6 app/lib/actions/helpers/lock.rb