foreman-tasks 0.8.2 → 0.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/models/foreman_tasks/lock.rb +1 -1
- data/app/views/foreman_tasks/recurring_logics/index.html.erb +1 -1
- data/app/views/foreman_tasks/tasks/_running_steps.html.erb +1 -1
- data/app/views/foreman_tasks/tasks/index.html.erb +1 -1
- data/db/migrate/20160920151810_add_more_lock_indexes.rb +8 -0
- data/db/migrate/20160924213030_change_tasks_widget_names.rb +15 -0
- data/db/migrate/20161003091412_add_missing_indexes.rb +30 -0
- data/foreman-tasks.gemspec +1 -1
- data/lib/foreman_tasks/dynflow.rb +8 -2
- data/lib/foreman_tasks/engine.rb +3 -3
- data/lib/foreman_tasks/version.rb +1 -1
- data/test/unit/dynflow_console_authorizer_test.rb +1 -5
- metadata +7 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 92e635ff069d028c5e508c825046421fbb15ab24
|
4
|
+
data.tar.gz: 7db062afc016cbe574b668f506acd8b6ed15c249
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc9435af11573a58fe294b01faf8e000daca7d8302a43fcb35e6a3d334989af3a6bdb5af352ea47e2eaef693eed292d1db21274bcac58031581927eeb3abf889
|
7
|
+
data.tar.gz: fd81d5816a6b0155e94e11a6a802fff790b73f7c037b1d608824615e18fa03dc391a18b15e1a0108907d8b15ce94ea2211134d924746dd10de13f6707a0905f2
|
@@ -5,7 +5,7 @@
|
|
5
5
|
<%= _("No running steps") %>
|
6
6
|
<% else %>
|
7
7
|
<% running_steps.each do |step| %>
|
8
|
-
<% action =
|
8
|
+
<% action = step.action(@task.execution_plan) %>
|
9
9
|
<div class="alert alert-warning">
|
10
10
|
<p>
|
11
11
|
<% if @task.cancellable_action?(action) %>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
class AddMoreLockIndexes < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
add_index(:foreman_tasks_tasks, [:id, :state],
|
4
|
+
:name => 'index_foreman_tasks_id_state')
|
5
|
+
add_index(:foreman_tasks_locks, [:name, :resource_type, :resource_id],
|
6
|
+
:name => 'index_foreman_tasks_locks_name_resource_type_resource_id')
|
7
|
+
end
|
8
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
class ChangeTasksWidgetNames < ActiveRecord::Migration
|
2
|
+
def up
|
3
|
+
Widget.where(:name => 'Tasks Status table').\
|
4
|
+
update_all(:name => 'Task Status')
|
5
|
+
Widget.where(:name => 'Tasks in Error/Warning').\
|
6
|
+
update_all(:name => 'Latest Warning/Error Tasks')
|
7
|
+
end
|
8
|
+
|
9
|
+
def down
|
10
|
+
Widget.where(:name => 'Task Status').\
|
11
|
+
update_all(:name => 'Tasks Status table')
|
12
|
+
Widget.where(:name => 'Latest Warning/Error Tasks').\
|
13
|
+
update_all(:name => 'Tasks in Error/Warning')
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
class AddMissingIndexes < ActiveRecord::Migration
|
2
|
+
# since this is just making sure the indexes we defined before are
|
3
|
+
# really added we don't define the down direction here.
|
4
|
+
# The support for defining index at column definition was added in Rails here
|
5
|
+
# https://github.com/rails/rails/commit/9a0d35e820464f872b0340366dded639f00e19b9
|
6
|
+
# We need to fix migrations that happened before Rails 4.2
|
7
|
+
def up
|
8
|
+
add_index_unless_exists(:foreman_tasks_task_groups, :type)
|
9
|
+
add_index_unless_exists(:foreman_tasks_tasks, :id)
|
10
|
+
add_index_unless_exists(:foreman_tasks_tasks, :type)
|
11
|
+
add_index_unless_exists(:foreman_tasks_tasks, :label)
|
12
|
+
add_index_unless_exists(:foreman_tasks_tasks, :started_at)
|
13
|
+
add_index_unless_exists(:foreman_tasks_tasks, :start_at)
|
14
|
+
add_index_unless_exists(:foreman_tasks_tasks, :start_before)
|
15
|
+
add_index_unless_exists(:foreman_tasks_tasks, :ended_at)
|
16
|
+
add_index_unless_exists(:foreman_tasks_tasks, :state)
|
17
|
+
add_index_unless_exists(:foreman_tasks_tasks, :result)
|
18
|
+
add_index_unless_exists(:foreman_tasks_tasks, :external_id)
|
19
|
+
add_index_unless_exists(:foreman_tasks_tasks, :parent_task_id)
|
20
|
+
add_index_unless_exists(:foreman_tasks_locks, :task_id)
|
21
|
+
add_index_unless_exists(:foreman_tasks_locks, :name)
|
22
|
+
add_index_unless_exists(:foreman_tasks_locks, :exclusive)
|
23
|
+
end
|
24
|
+
|
25
|
+
def add_index_unless_exists(table, attribute)
|
26
|
+
unless indexes(table).any? { |index| index.columns == [attribute.to_s] }
|
27
|
+
add_index(table, attribute)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
data/foreman-tasks.gemspec
CHANGED
@@ -29,7 +29,7 @@ DESC
|
|
29
29
|
s.extra_rdoc_files = Dir['README*', 'LICENSE']
|
30
30
|
|
31
31
|
s.add_dependency "foreman-tasks-core"
|
32
|
-
s.add_dependency "dynflow", '~> 0.8.
|
32
|
+
s.add_dependency "dynflow", '~> 0.8.16'
|
33
33
|
s.add_dependency "sequel" # for Dynflow process persistence
|
34
34
|
s.add_dependency "sinatra" # for Dynflow web console
|
35
35
|
s.add_dependency "daemons" # for running remote executor
|
@@ -44,8 +44,11 @@ module ForemanTasks
|
|
44
44
|
# don't try to do any rescuing until the tables are properly migrated
|
45
45
|
if !Foreman.in_rake?('db:migrate') && (ForemanTasks::Task.table_exists? rescue(false))
|
46
46
|
config.run_on_init_hooks(world)
|
47
|
-
|
48
|
-
|
47
|
+
# leave this just for long-running executors
|
48
|
+
unless config.rake_task_with_executor?
|
49
|
+
world.auto_execute
|
50
|
+
ForemanTasks::Task::DynflowTask.consistency_check
|
51
|
+
end
|
49
52
|
end
|
50
53
|
end
|
51
54
|
end
|
@@ -88,6 +91,9 @@ module ForemanTasks
|
|
88
91
|
end
|
89
92
|
end
|
90
93
|
|
94
|
+
set(:custom_navigation) do
|
95
|
+
{ _("Back to tasks") => "/#{ForemanTasks::TasksController.controller_path}" }
|
96
|
+
end
|
91
97
|
set(:world) { ForemanTasks.dynflow.world }
|
92
98
|
end
|
93
99
|
end
|
data/lib/foreman_tasks/engine.rb
CHANGED
@@ -47,7 +47,7 @@ module ForemanTasks
|
|
47
47
|
|
48
48
|
menu :top_menu, :recurring_logics,
|
49
49
|
:url_hash => { :controller => 'foreman_tasks/recurring_logics', :action => :index },
|
50
|
-
:caption => N_('Recurring
|
50
|
+
:caption => N_('Recurring Logics'),
|
51
51
|
:parent => :monitor_menu,
|
52
52
|
:last => true
|
53
53
|
|
@@ -73,8 +73,8 @@ module ForemanTasks
|
|
73
73
|
role "Tasks Manager", [:view_foreman_tasks, :edit_foreman_tasks]
|
74
74
|
role "Tasks Reader", [:view_foreman_tasks]
|
75
75
|
|
76
|
-
widget 'foreman_tasks/tasks/dashboard/tasks_status', :sizex=>6, :sizey=>1, :name=> N_('
|
77
|
-
widget 'foreman_tasks/tasks/dashboard/latest_tasks_in_error_warning', :sizex=>6, :sizey=>1,:name=> N_('
|
76
|
+
widget 'foreman_tasks/tasks/dashboard/tasks_status', :sizex=>6, :sizey=>1, :name=> N_('Task Status')
|
77
|
+
widget 'foreman_tasks/tasks/dashboard/latest_tasks_in_error_warning', :sizex=>6, :sizey=>1,:name=> N_('Latest Warning/Error Tasks')
|
78
78
|
end
|
79
79
|
end
|
80
80
|
|
@@ -12,11 +12,7 @@ module ForemanTasks
|
|
12
12
|
let(:foreign_task) { FactoryGirl.create(:dynflow_task) }
|
13
13
|
|
14
14
|
let(:edit_foreman_tasks_permission) do
|
15
|
-
|
16
|
-
permission.name = :edit_foreman_tasks
|
17
|
-
permission.resource_type = ForemanTasks::Task.name
|
18
|
-
permission.save!
|
19
|
-
end
|
15
|
+
Permission.where(:name => :edit_foreman_tasks).first
|
20
16
|
end
|
21
17
|
|
22
18
|
def dynflow_console_authorized?(task = nil)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman-tasks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ivan Nečas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: foreman-tasks-core
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.8.
|
33
|
+
version: 0.8.16
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.8.
|
40
|
+
version: 0.8.16
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: sequel
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -197,6 +197,9 @@ files:
|
|
197
197
|
- db/migrate/20150907131503_create_task_groups.rb
|
198
198
|
- db/migrate/20151022123457_add_recurring_logic_state.rb
|
199
199
|
- db/migrate/20151112152108_create_triggerings.rb
|
200
|
+
- db/migrate/20160920151810_add_more_lock_indexes.rb
|
201
|
+
- db/migrate/20160924213030_change_tasks_widget_names.rb
|
202
|
+
- db/migrate/20161003091412_add_missing_indexes.rb
|
200
203
|
- db/seeds.d/20-foreman_tasks_permissions.rb
|
201
204
|
- db/seeds.d/60-dynflow_proxy_feature.rb
|
202
205
|
- db/seeds.d/61-foreman_tasks_bookmarks.rb
|