foreman_maintain 1.0.17 → 1.0.19

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 84beb23b16dd631324e77e864150007d3c9dd9cd610e8d5e98471b836f1225d0
4
- data.tar.gz: 44b3168e40102a7721faf2429519df681feed5e296bbfd14c12764eb042e953b
3
+ metadata.gz: 16cb6948c9fce9920fd8916aba9c0ecb641b6acfee457aa984599976287e097b
4
+ data.tar.gz: ed5f56c95835b3c742323686d4207c33d9c5c1d37a9760013bb3810597f6296b
5
5
  SHA512:
6
- metadata.gz: 2bb749f61ed5c56b9120a39284d1a871ab9d2ad6be79d291bdf44a368c74f8e78c8f3db2ee19b1c8c796c20d2cb9536c128509059806bb1adff4f030b9182590
7
- data.tar.gz: 02b7559f820145c7255a0346490d93328c0304c2188a7f2293494a626a89d431a75e275ee5ebb86a098979fe8c966f53f9936748d13467eb092cef7fe7ceb399
6
+ metadata.gz: e6daa7f789d47bf1d810f9974a34955695151f4481db5b0d5628de85fe97ede1dd7202985de28e8ca2d010abdef02b51509aa242abce37773daf8afda135b67c
7
+ data.tar.gz: fc1e55d663a20afa249d409318800282a78b652b9ebc1cb1bb5655a9ef608d79be1c5434421dfcbd3d3906b156d5262aca8dbcfb05b0de61b8342ef8ffb9e87f
@@ -75,7 +75,7 @@ class Features::CandlepinDatabase < ForemanMaintain::Feature
75
75
  # rubocop:enable Metrics/MethodLength
76
76
 
77
77
  def extend_with_db_options
78
- db_options = { '-d' => construct_database_string }
78
+ db_options = { '-d' => configuration['database'] }
79
79
  if check_option_using_cpdb_help('dbhost')
80
80
  db_options['--dbhost'] = configuration['host']
81
81
  db_options['--dbport'] = configuration['port']
@@ -83,15 +83,6 @@ class Features::CandlepinDatabase < ForemanMaintain::Feature
83
83
  db_options
84
84
  end
85
85
 
86
- def construct_database_string
87
- db_str = configuration['database']
88
- extra_opts = []
89
- extra_opts << "ssl=#{configuration['ssl']}" if configuration['ssl']
90
- extra_opts << "sslfactory=#{configuration['sslfactory']}" if configuration['sslfactory']
91
- db_str += "?#{extra_opts.join('&')}" unless extra_opts.empty?
92
- db_str
93
- end
94
-
95
86
  def fetch_extra_param(url, key_name)
96
87
  query_string = url.split('?')[1]
97
88
  return nil unless query_string
@@ -0,0 +1,22 @@
1
+ module Procedures::Restore
2
+ class ReindexDatabases < ForemanMaintain::Procedure
3
+ include ForemanMaintain::Concerns::SystemService
4
+
5
+ metadata do
6
+ description 'REINDEX databases'
7
+
8
+ confine do
9
+ feature(:instance).postgresql_local?
10
+ end
11
+ end
12
+
13
+ def run
14
+ with_spinner('Reindexing the databases') do |spinner|
15
+ feature(:service).handle_services(spinner, 'start', :only => ['postgresql'])
16
+
17
+ spinner.update('Reindexing the databases')
18
+ execute!('runuser - postgres -c "reindexdb -a"')
19
+ end
20
+ end
21
+ end
22
+ end
@@ -45,6 +45,11 @@ module ForemanMaintain::Scenarios
45
45
  add_step(Procedures::Service::Stop.new(:only => ['postgresql']))
46
46
  end
47
47
  restore_mongo_dump(backup)
48
+
49
+ if feature(:instance).postgresql_local? && !backup.online_backup?
50
+ add_step_with_context(Procedures::Restore::ReindexDatabases)
51
+ end
52
+
48
53
  add_steps_with_context(Procedures::Pulp::Migrate,
49
54
  Procedures::Pulpcore::Migrate,
50
55
  Procedures::Restore::CandlepinResetMigrations)
@@ -2,11 +2,11 @@ module ForemanMaintain::Scenarios
2
2
  class SelfUpgradeBase < ForemanMaintain::Scenario
3
3
  include ForemanMaintain::Concerns::Downstream
4
4
  def target_version
5
- @target_version ||= current_version.bump
5
+ @target_version ||= Gem::Version.new(current_version).bump.to_s
6
6
  end
7
7
 
8
8
  def current_version
9
- feature(:instance).downstream.current_minor_version
9
+ feature(:instance).downstream.current_version.to_s[/^\d+\.\d+\.\d+/]
10
10
  end
11
11
 
12
12
  def maintenance_repo_label
@@ -66,7 +66,8 @@ module ForemanMaintain
66
66
  server_version_full = "#{server_version.major}.#{server_version.minor}"
67
67
  rh_repos.concat(product_specific_repos(server_version_full))
68
68
  if server_version > version('6.3')
69
- rh_repos << ansible_repo(server_version)
69
+ ansible_repo = ansible_repo(server_version)
70
+ rh_repos << ansible_repo if ansible_repo
70
71
  end
71
72
 
72
73
  rh_repos
@@ -83,8 +84,6 @@ module ForemanMaintain
83
84
 
84
85
  if el7?
85
86
  "rhel-#{el_major_version}-server-ansible-#{ansible_version}-rpms"
86
- else
87
- "ansible-#{ansible_version}-for-rhel-#{el_major_version}-x86_64-rpms"
88
87
  end
89
88
  end
90
89
 
@@ -1,3 +1,3 @@
1
1
  module ForemanMaintain
2
- VERSION = '1.0.17'.freeze
2
+ VERSION = '1.0.19'.freeze
3
3
  end
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: 1.0.17
4
+ version: 1.0.19
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-09-26 00:00:00.000000000 Z
11
+ date: 2023-02-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: clamp
@@ -108,6 +108,20 @@ dependencies:
108
108
  - - '='
109
109
  - !ruby/object:Gem::Version
110
110
  version: 0.50.0
111
+ - !ruby/object:Gem::Dependency
112
+ name: minitest-stub-const
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
111
125
  description: Provides various features that helps keeping the Foreman/Satellite up
112
126
  and running.
113
127
  email: inecas@redhat.com
@@ -311,6 +325,7 @@ files:
311
325
  - definitions/procedures/restore/postgres_owner.rb
312
326
  - definitions/procedures/restore/pulpcore_dump.rb
313
327
  - definitions/procedures/restore/regenerate_queues.rb
328
+ - definitions/procedures/restore/reindex_databases.rb
314
329
  - definitions/procedures/selinux/set_file_security.rb
315
330
  - definitions/procedures/service/base.rb
316
331
  - definitions/procedures/service/daemon_reload.rb
@@ -468,7 +483,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
468
483
  - !ruby/object:Gem::Version
469
484
  version: '0'
470
485
  requirements: []
471
- rubygems_version: 3.2.33
486
+ rubygems_version: 3.3.26
472
487
  signing_key:
473
488
  specification_version: 4
474
489
  summary: Foreman maintenance tool belt