foreman_maintain 1.0.5 → 1.0.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bda89886170f69276ffe2a0fcca046581c62096011e59251f199d451a6e49ddb
4
- data.tar.gz: 5f63a1d69ab49281d15e1d4004f1726d9c7b45eccbeeaa0015615176c7973e01
3
+ metadata.gz: 41c40d80a596e78552a9e066e6d769db4fe57cd9e7c7368a7d64cf21f68edefa
4
+ data.tar.gz: 4908652d3cc57dde9b08081b0d5fa20fac5cc9f8ab41f19778243a29b0963002
5
5
  SHA512:
6
- metadata.gz: a2e1859b3479357698652f5b448e97e9ebe4977b6f71a851efc7498ae8f9e622d4a0a69a6589a8206d00071129345bceacececf04133fb958f85924c9c5ba79b
7
- data.tar.gz: 4db6f08840e3767357d0d57a9b32ff61779627e03118396ca41c99f2ea3f7ea355596e7d353dc1352b56290b7c4fc6b81a17bf74dad09cadf76b52af660cfc32
6
+ metadata.gz: aa7003129978adaa2e1798c3fa191a5be628403b1d86df618bd92110829de5b8f0cd81a2f6c97b1df2befeeda693ba950acdf985c843482d2d027d333e771957
7
+ data.tar.gz: 1c16a69c401058063919df5c8b8a595a4b04d17c5662f93e12b9999bfa5e566f6276b1b4a1998ffb5a3d3f964af76a8275eae68554826a22b4aef8f3ca7b81fb
@@ -82,15 +82,22 @@ class Features::ForemanTasks < ForemanMaintain::Feature
82
82
  def delete(state)
83
83
  tasks_condition = condition(state)
84
84
 
85
- feature(:foreman_database).psql(<<-SQL)
86
- BEGIN;
87
- DELETE FROM dynflow_steps USING foreman_tasks_tasks WHERE (foreman_tasks_tasks.external_id = dynflow_steps.execution_plan_uuid::varchar) AND #{tasks_condition};
88
- DELETE FROM dynflow_actions USING foreman_tasks_tasks WHERE (foreman_tasks_tasks.external_id = dynflow_actions.execution_plan_uuid::varchar) AND #{tasks_condition};
89
- DELETE FROM dynflow_execution_plans USING foreman_tasks_tasks WHERE (foreman_tasks_tasks.external_id = dynflow_execution_plans.uuid::varchar) AND #{tasks_condition};
90
- DELETE FROM foreman_tasks_tasks WHERE #{tasks_condition};
91
- 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);
92
92
  SQL
93
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
+
94
101
  count(state)
95
102
  end
96
103
 
@@ -1,4 +1,4 @@
1
- module Scenarios::Capsule_7_0
1
+ module Scenarios::Capsule_6_11
2
2
  class Abstract < ForemanMaintain::Scenario
3
3
  def self.upgrade_metadata(&block)
4
4
  metadata do
@@ -6,20 +6,20 @@ module Scenarios::Capsule_7_0
6
6
  confine do
7
7
  feature(:capsule) &&
8
8
  (feature(:capsule).current_minor_version == '6.10' || \
9
- ForemanMaintain.upgrade_in_progress == '7.0')
9
+ ForemanMaintain.upgrade_in_progress == '6.11')
10
10
  end
11
11
  instance_eval(&block)
12
12
  end
13
13
  end
14
14
 
15
15
  def target_version
16
- '7.0'
16
+ '6.11'
17
17
  end
18
18
  end
19
19
 
20
20
  class PreUpgradeCheck < Abstract
21
21
  upgrade_metadata do
22
- description 'Checks before upgrading to Capsule 7.0'
22
+ description 'Checks before upgrading to Capsule 6.11'
23
23
  tags :pre_upgrade_checks
24
24
  run_strategy :fail_slow
25
25
  end
@@ -27,13 +27,13 @@ module Scenarios::Capsule_7_0
27
27
  def compose
28
28
  add_steps(find_checks(:default))
29
29
  add_steps(find_checks(:pre_upgrade))
30
- add_step(Checks::Repositories::Validate.new(:version => '7.0'))
30
+ add_step(Checks::Repositories::Validate.new(:version => '6.11'))
31
31
  end
32
32
  end
33
33
 
34
34
  class PreMigrations < Abstract
35
35
  upgrade_metadata do
36
- description 'Procedures before migrating to Capsule 7.0'
36
+ description 'Procedures before migrating to Capsule 6.11'
37
37
  tags :pre_migrations
38
38
  end
39
39
 
@@ -46,7 +46,7 @@ module Scenarios::Capsule_7_0
46
46
 
47
47
  class Migrations < Abstract
48
48
  upgrade_metadata do
49
- description 'Migration scripts to Capsule 7.0'
49
+ description 'Migration scripts to Capsule 6.11'
50
50
  tags :migrations
51
51
  end
52
52
 
@@ -55,7 +55,7 @@ module Scenarios::Capsule_7_0
55
55
  end
56
56
 
57
57
  def compose
58
- add_step(Procedures::Repositories::Setup.new(:version => '7.0'))
58
+ add_step(Procedures::Repositories::Setup.new(:version => '6.11'))
59
59
  add_step(Procedures::Packages::UnlockVersions.new)
60
60
  add_step(Procedures::Packages::Update.new(:assumeyes => true))
61
61
  add_step_with_context(Procedures::Installer::Upgrade)
@@ -64,7 +64,7 @@ module Scenarios::Capsule_7_0
64
64
 
65
65
  class PostMigrations < Abstract
66
66
  upgrade_metadata do
67
- description 'Procedures after migrating to Capsule 7.0'
67
+ description 'Procedures after migrating to Capsule 6.11'
68
68
  tags :post_migrations
69
69
  end
70
70
 
@@ -77,7 +77,7 @@ module Scenarios::Capsule_7_0
77
77
 
78
78
  class PostUpgradeChecks < Abstract
79
79
  upgrade_metadata do
80
- description 'Checks after upgrading to Capsule 7.0'
80
+ description 'Checks after upgrading to Capsule 6.11'
81
81
  tags :post_upgrade_checks
82
82
  run_strategy :fail_slow
83
83
  end
@@ -1,25 +1,25 @@
1
- module Scenarios::Capsule_7_0_z
1
+ module Scenarios::Capsule_6_11_z
2
2
  class Abstract < ForemanMaintain::Scenario
3
3
  def self.upgrade_metadata(&block)
4
4
  metadata do
5
5
  tags :upgrade_scenario
6
6
  confine do
7
7
  feature(:capsule) &&
8
- (feature(:capsule).current_minor_version == '7.0' || \
9
- ForemanMaintain.upgrade_in_progress == '7.0.z')
8
+ (feature(:capsule).current_minor_version == '6.11' || \
9
+ ForemanMaintain.upgrade_in_progress == '6.11.z')
10
10
  end
11
11
  instance_eval(&block)
12
12
  end
13
13
  end
14
14
 
15
15
  def target_version
16
- '7.0.z'
16
+ '6.11.z'
17
17
  end
18
18
  end
19
19
 
20
20
  class PreUpgradeCheck < Abstract
21
21
  upgrade_metadata do
22
- description 'Checks before upgrading to Capsule 7.0.z'
22
+ description 'Checks before upgrading to Capsule 6.11.z'
23
23
  tags :pre_upgrade_checks
24
24
  run_strategy :fail_slow
25
25
  end
@@ -27,13 +27,13 @@ module Scenarios::Capsule_7_0_z
27
27
  def compose
28
28
  add_steps(find_checks(:default))
29
29
  add_steps(find_checks(:pre_upgrade))
30
- add_step(Checks::Repositories::Validate.new(:version => '7.0'))
30
+ add_step(Checks::Repositories::Validate.new(:version => '6.11'))
31
31
  end
32
32
  end
33
33
 
34
34
  class PreMigrations < Abstract
35
35
  upgrade_metadata do
36
- description 'Procedures before migrating to Capsule 7.0.z'
36
+ description 'Procedures before migrating to Capsule 6.11.z'
37
37
  tags :pre_migrations
38
38
  end
39
39
 
@@ -45,7 +45,7 @@ module Scenarios::Capsule_7_0_z
45
45
 
46
46
  class Migrations < Abstract
47
47
  upgrade_metadata do
48
- description 'Migration scripts to Capsule 7.0.z'
48
+ description 'Migration scripts to Capsule 6.11.z'
49
49
  tags :migrations
50
50
  end
51
51
 
@@ -54,7 +54,7 @@ module Scenarios::Capsule_7_0_z
54
54
  end
55
55
 
56
56
  def compose
57
- add_step(Procedures::Repositories::Setup.new(:version => '7.0'))
57
+ add_step(Procedures::Repositories::Setup.new(:version => '6.11'))
58
58
  add_step(Procedures::Packages::UnlockVersions.new)
59
59
  add_step(Procedures::Packages::Update.new(:assumeyes => true))
60
60
  add_step_with_context(Procedures::Installer::Upgrade)
@@ -63,7 +63,7 @@ module Scenarios::Capsule_7_0_z
63
63
 
64
64
  class PostMigrations < Abstract
65
65
  upgrade_metadata do
66
- description 'Procedures after migrating to Capsule 7.0.z'
66
+ description 'Procedures after migrating to Capsule 6.11.z'
67
67
  tags :post_migrations
68
68
  end
69
69
 
@@ -76,7 +76,7 @@ module Scenarios::Capsule_7_0_z
76
76
 
77
77
  class PostUpgradeChecks < Abstract
78
78
  upgrade_metadata do
79
- description 'Checks after upgrading to Capsule 7.0.z'
79
+ description 'Checks after upgrading to Capsule 6.11.z'
80
80
  tags :post_upgrade_checks
81
81
  run_strategy :fail_slow
82
82
  end
@@ -1,4 +1,4 @@
1
- module Scenarios::Satellite_7_0
1
+ module Scenarios::Satellite_6_11
2
2
  class Abstract < ForemanMaintain::Scenario
3
3
  def self.upgrade_metadata(&block)
4
4
  metadata do
@@ -6,20 +6,20 @@ module Scenarios::Satellite_7_0
6
6
  confine do
7
7
  feature(:satellite) &&
8
8
  (feature(:satellite).current_minor_version == '6.10' || \
9
- ForemanMaintain.upgrade_in_progress == '7.0')
9
+ ForemanMaintain.upgrade_in_progress == '6.11')
10
10
  end
11
11
  instance_eval(&block)
12
12
  end
13
13
  end
14
14
 
15
15
  def target_version
16
- '7.0'
16
+ '6.11'
17
17
  end
18
18
  end
19
19
 
20
20
  class PreUpgradeCheck < Abstract
21
21
  upgrade_metadata do
22
- description 'Checks before upgrading to Satellite 7.0'
22
+ description 'Checks before upgrading to Satellite 6.11'
23
23
  tags :pre_upgrade_checks
24
24
  run_strategy :fail_slow
25
25
  end
@@ -29,13 +29,13 @@ module Scenarios::Satellite_7_0
29
29
  add_steps(find_checks(:pre_upgrade))
30
30
 
31
31
  add_step(Checks::Foreman::CheckpointSegments)
32
- add_step(Checks::Repositories::Validate.new(:version => '7.0'))
32
+ add_step(Checks::Repositories::Validate.new(:version => '6.11'))
33
33
  end
34
34
  end
35
35
 
36
36
  class PreMigrations < Abstract
37
37
  upgrade_metadata do
38
- description 'Procedures before migrating to Satellite 7.0'
38
+ description 'Procedures before migrating to Satellite 6.11'
39
39
  tags :pre_migrations
40
40
  end
41
41
 
@@ -48,7 +48,7 @@ module Scenarios::Satellite_7_0
48
48
 
49
49
  class Migrations < Abstract
50
50
  upgrade_metadata do
51
- description 'Migration scripts to Satellite 7.0'
51
+ description 'Migration scripts to Satellite 6.11'
52
52
  tags :migrations
53
53
  run_strategy :fail_fast
54
54
  end
@@ -58,7 +58,7 @@ module Scenarios::Satellite_7_0
58
58
  end
59
59
 
60
60
  def compose
61
- add_step(Procedures::Repositories::Setup.new(:version => '7.0'))
61
+ add_step(Procedures::Repositories::Setup.new(:version => '6.11'))
62
62
  add_step(Procedures::Packages::UnlockVersions.new)
63
63
  add_step(Procedures::Packages::Update.new(:assumeyes => true))
64
64
  add_step_with_context(Procedures::Installer::Upgrade)
@@ -68,7 +68,7 @@ module Scenarios::Satellite_7_0
68
68
 
69
69
  class PostMigrations < Abstract
70
70
  upgrade_metadata do
71
- description 'Procedures after migrating to Satellite 7.0'
71
+ description 'Procedures after migrating to Satellite 6.11'
72
72
  tags :post_migrations
73
73
  end
74
74
 
@@ -81,7 +81,7 @@ module Scenarios::Satellite_7_0
81
81
 
82
82
  class PostUpgradeChecks < Abstract
83
83
  upgrade_metadata do
84
- description 'Checks after upgrading to Satellite 7.0'
84
+ description 'Checks after upgrading to Satellite 6.11'
85
85
  tags :post_upgrade_checks
86
86
  run_strategy :fail_slow
87
87
  end
@@ -1,25 +1,25 @@
1
- module Scenarios::Satellite_7_0_z
1
+ module Scenarios::Satellite_6_11_z
2
2
  class Abstract < ForemanMaintain::Scenario
3
3
  def self.upgrade_metadata(&block)
4
4
  metadata do
5
5
  tags :upgrade_scenario
6
6
  confine do
7
7
  feature(:satellite) &&
8
- (feature(:satellite).current_minor_version == '7.0' || \
9
- ForemanMaintain.upgrade_in_progress == '7.0.z')
8
+ (feature(:satellite).current_minor_version == '6.11' || \
9
+ ForemanMaintain.upgrade_in_progress == '6.11.z')
10
10
  end
11
11
  instance_eval(&block)
12
12
  end
13
13
  end
14
14
 
15
15
  def target_version
16
- '7.0.z'
16
+ '6.11.z'
17
17
  end
18
18
  end
19
19
 
20
20
  class PreUpgradeCheck < Abstract
21
21
  upgrade_metadata do
22
- description 'Checks before upgrading to Satellite 7.0.z'
22
+ description 'Checks before upgrading to Satellite 6.11.z'
23
23
  tags :pre_upgrade_checks
24
24
  run_strategy :fail_slow
25
25
  end
@@ -27,13 +27,13 @@ module Scenarios::Satellite_7_0_z
27
27
  def compose
28
28
  add_steps(find_checks(:default))
29
29
  add_steps(find_checks(:pre_upgrade))
30
- add_step(Checks::Repositories::Validate.new(:version => '7.0'))
30
+ add_step(Checks::Repositories::Validate.new(:version => '6.11'))
31
31
  end
32
32
  end
33
33
 
34
34
  class PreMigrations < Abstract
35
35
  upgrade_metadata do
36
- description 'Procedures before migrating to Satellite 7.0.z'
36
+ description 'Procedures before migrating to Satellite 6.11.z'
37
37
  tags :pre_migrations
38
38
  end
39
39
 
@@ -45,7 +45,7 @@ module Scenarios::Satellite_7_0_z
45
45
 
46
46
  class Migrations < Abstract
47
47
  upgrade_metadata do
48
- description 'Migration scripts to Satellite 7.0.z'
48
+ description 'Migration scripts to Satellite 6.11.z'
49
49
  tags :migrations
50
50
  end
51
51
 
@@ -54,7 +54,7 @@ module Scenarios::Satellite_7_0_z
54
54
  end
55
55
 
56
56
  def compose
57
- add_step(Procedures::Repositories::Setup.new(:version => '7.0'))
57
+ add_step(Procedures::Repositories::Setup.new(:version => '6.11'))
58
58
  add_step(Procedures::Packages::UnlockVersions.new)
59
59
  add_step(Procedures::Packages::Update.new(:assumeyes => true))
60
60
  add_step_with_context(Procedures::Installer::Upgrade)
@@ -64,7 +64,7 @@ module Scenarios::Satellite_7_0_z
64
64
 
65
65
  class PostMigrations < Abstract
66
66
  upgrade_metadata do
67
- description 'Procedures after migrating to Satellite 7.0.z'
67
+ description 'Procedures after migrating to Satellite 6.11.z'
68
68
  tags :post_migrations
69
69
  end
70
70
 
@@ -77,7 +77,7 @@ module Scenarios::Satellite_7_0_z
77
77
 
78
78
  class PostUpgradeChecks < Abstract
79
79
  upgrade_metadata do
80
- description 'Checks after upgrading to Satellite 7.0.z'
80
+ description 'Checks after upgrading to Satellite 6.11.z'
81
81
  tags :post_upgrade_checks
82
82
  run_strategy :fail_slow
83
83
  end
@@ -3,7 +3,7 @@ module ForemanMaintain
3
3
  class SelfUpgradeCommand < Base
4
4
  option ['--target-version'], 'TARGET_VERSION',\
5
5
  'Major version of the Satellite or Capsule'\
6
- ', e.g 7.0', :required => true
6
+ ', e.g 6.11', :required => true
7
7
  def execute
8
8
  allow_major_version_upgrade_only
9
9
  run_scenario(upgrade_scenario, upgrade_rescue_scenario)
@@ -116,7 +116,7 @@ module ForemanMaintain
116
116
  end
117
117
 
118
118
  def common_repos(full_version)
119
- sat_maint_version = if version(full_version) >= version('7.0') && !use_beta_repos?
119
+ sat_maint_version = if version(full_version) >= version('6.11') && !use_beta_repos?
120
120
  full_version
121
121
  else
122
122
  full_version[0]
@@ -1,3 +1,3 @@
1
1
  module ForemanMaintain
2
- VERSION = '1.0.5'.freeze
2
+ VERSION = '1.0.6'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_maintain
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Nečas
@@ -334,14 +334,16 @@ files:
334
334
  - definitions/scenarios/services.rb
335
335
  - definitions/scenarios/upgrade_to_capsule_6_10.rb
336
336
  - definitions/scenarios/upgrade_to_capsule_6_10_z.rb
337
+ - definitions/scenarios/upgrade_to_capsule_6_11.rb
338
+ - definitions/scenarios/upgrade_to_capsule_6_11_z.rb
337
339
  - definitions/scenarios/upgrade_to_capsule_6_8.rb
338
340
  - definitions/scenarios/upgrade_to_capsule_6_8_z.rb
339
341
  - definitions/scenarios/upgrade_to_capsule_6_9.rb
340
342
  - definitions/scenarios/upgrade_to_capsule_6_9_z.rb
341
- - definitions/scenarios/upgrade_to_capsule_7_0.rb
342
- - definitions/scenarios/upgrade_to_capsule_7_0_z.rb
343
343
  - definitions/scenarios/upgrade_to_satellite_6_10.rb
344
344
  - definitions/scenarios/upgrade_to_satellite_6_10_z.rb
345
+ - definitions/scenarios/upgrade_to_satellite_6_11.rb
346
+ - definitions/scenarios/upgrade_to_satellite_6_11_z.rb
345
347
  - definitions/scenarios/upgrade_to_satellite_6_2.rb
346
348
  - definitions/scenarios/upgrade_to_satellite_6_2_z.rb
347
349
  - definitions/scenarios/upgrade_to_satellite_6_3.rb
@@ -358,8 +360,6 @@ files:
358
360
  - definitions/scenarios/upgrade_to_satellite_6_8_z.rb
359
361
  - definitions/scenarios/upgrade_to_satellite_6_9.rb
360
362
  - definitions/scenarios/upgrade_to_satellite_6_9_z.rb
361
- - definitions/scenarios/upgrade_to_satellite_7_0.rb
362
- - definitions/scenarios/upgrade_to_satellite_7_0_z.rb
363
363
  - extras/foreman-maintain.sh
364
364
  - extras/foreman_protector/foreman-protector.conf
365
365
  - extras/foreman_protector/foreman-protector.py