foreman_maintain 0.8.24 → 0.8.25
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/definitions/features/foreman_tasks.rb +14 -10
- data/lib/foreman_maintain/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5fd64b664ab2e4651af4f4c42f19e4418a7e2890537fceac8dd5cd15acdef8fe
|
4
|
+
data.tar.gz: 906efdc85144a0cc9a62ff45351e8be0f24268337fe42ec4251796ce19031268
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dbe5d5ac12761231471d1779aa5f6e0cfc28b204340775b54c7843b888d2f1eb7b2fd10d1eacbc5c31c50aaa320e2e707759601166c9611659f4db7b1d3b52a0
|
7
|
+
data.tar.gz: 622b67bfef11facd70f05ddb620183c94dc3edd840863a22220956982da2efe33d9982a40ee159809a49a54d0cfcd2371d74b7cb31b56b4350c7a51888f3f4ab
|
@@ -82,18 +82,22 @@ class Features::ForemanTasks < ForemanMaintain::Feature
|
|
82
82
|
def delete(state)
|
83
83
|
tasks_condition = condition(state)
|
84
84
|
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
DELETE FROM foreman_tasks_locks as ftl where ftl.id NOT IN (SELECT id FROM foreman_tasks_tasks);
|
93
|
-
DELETE FROM foreman_tasks_links as ftl where ftl.id NOT IN (SELECT id FROM foreman_tasks_tasks);
|
94
|
-
COMMIT;
|
85
|
+
sql = <<-SQL
|
86
|
+
DELETE FROM dynflow_steps USING foreman_tasks_tasks WHERE (foreman_tasks_tasks.external_id = dynflow_steps.execution_plan_uuid::varchar) AND #{tasks_condition};
|
87
|
+
DELETE FROM dynflow_actions USING foreman_tasks_tasks WHERE (foreman_tasks_tasks.external_id = dynflow_actions.execution_plan_uuid::varchar) AND #{tasks_condition};
|
88
|
+
DELETE FROM dynflow_execution_plans USING foreman_tasks_tasks WHERE (foreman_tasks_tasks.external_id = dynflow_execution_plans.uuid::varchar) AND #{tasks_condition};
|
89
|
+
DELETE FROM foreman_tasks_tasks WHERE #{tasks_condition};
|
90
|
+
-- Delete locks and links which may now be orphaned
|
91
|
+
DELETE FROM foreman_tasks_locks as ftl where ftl.task_id NOT IN (SELECT id FROM foreman_tasks_tasks);
|
95
92
|
SQL
|
96
93
|
|
94
|
+
if check_min_version(foreman_plugin_name('foreman-tasks'), '4.0.0')
|
95
|
+
sql += 'DELETE FROM foreman_tasks_links as ftl ' \
|
96
|
+
'where ftl.task_id NOT IN (SELECT id FROM foreman_tasks_tasks);'
|
97
|
+
end
|
98
|
+
|
99
|
+
feature(:foreman_database).psql("BEGIN; #{sql}; COMMIT;")
|
100
|
+
|
97
101
|
count(state)
|
98
102
|
end
|
99
103
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman_maintain
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.25
|
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: 2022-03-
|
11
|
+
date: 2022-03-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: clamp
|