foreman-tasks 0.6.5 → 0.6.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -36,7 +36,7 @@ module ForemanTasks
36
36
  if task.paused?
37
37
  task.state = :stopped
38
38
  task.save!
39
- flash[:notice] = _('The task resrouces were unlocked.')
39
+ flash[:notice] = _('The task resources were unlocked.')
40
40
  else
41
41
  flash[:warning] = _('The execution has to be paused.')
42
42
  end
@@ -46,5 +46,10 @@ module Actions
46
46
  step.error.message if step.error
47
47
  end.compact
48
48
  end
49
+
50
+ def already_running?
51
+ ForemanTasks::Task::DynflowTask.for_action(self.class).
52
+ running.where('external_id != ?', execution_plan_id).any?
53
+ end
49
54
  end
50
55
  end
@@ -25,6 +25,7 @@ module ForemanTasks
25
25
  scoped_search :in => :owners, :on => :firstname, :complete_value => true, :rename => "owner.firstname", :ext_method => :search_by_owner
26
26
 
27
27
  scope :active, -> { where('state != ?', :stopped) }
28
+ scope :running, -> { where("state NOT IN ('stopped', 'paused')") }
28
29
  scope :for_resource,
29
30
  (lambda do |resource|
30
31
  joins(:locks).where(:"foreman_tasks_locks.resource_id" => resource.id,
@@ -1,3 +1,3 @@
1
1
  module ForemanTasks
2
- VERSION = "0.6.5"
2
+ VERSION = "0.6.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman-tasks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.5
4
+ version: 0.6.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-07-14 00:00:00.000000000 Z
12
+ date: 2014-07-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails