foreman_maintain 0.4.9 → 0.4.10

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: 7a9aa2cfbc30718a86ed4e30a33b512666147926b9f8dbc34b3e34f311167601
4
- data.tar.gz: 869ebe7840ade6dddd3f657ecd9878be6a64411dcf9626779f8357954f7cef4b
3
+ metadata.gz: 5e987c2a5c95bc27df7b64d739c05cd6779041dc417f13934586931d9e966889
4
+ data.tar.gz: 8a5e15f6c859d19b8392e620de886d18173327627ee79cf26732ae928fb79aff
5
5
  SHA512:
6
- metadata.gz: c58b43e156c4fa59e3398ad4c792031c948229aaa0f31a429dc14a03ad54c765885833e90f1567686544d3ed3b44f463b87f23f43efe420baf56376c0066af0d
7
- data.tar.gz: b28fd0788ddde4c8ef47f39987fa9f187ec5c634d30633bf335c9a8daf3f0bc53fe1ecf1f4b02579ae749e74a0c475c0033e2c759bd05ba71e8a730e262b7d15
6
+ metadata.gz: 7455550b50b9d07f3eb1b25a822624376b24f78f539c111ed88013bbc862811ea9da0984d57787ac292e579ae0a0778916b17698a9194c9ece457122986363f1
7
+ data.tar.gz: c70bc731147c15cc1d5bd177cf971d27dfdc096326b6268b7e4c21d95f75275043dbb528dce3ca1866293148c9f6f68aa47bb9370834e51595f804b0e7d3254a
@@ -80,6 +80,7 @@ def exclude_hook(conduit):
80
80
  'WARNING: Excluding %d update%s due to foreman-protector. \n'
81
81
  'Use foreman-maintain packages install/update <package> \n'
82
82
  'to safely install packages without restrictions.\n'
83
+ 'Use foreman-maintain upgrade run for full upgrade.\n'
83
84
  % (total, suffix))
84
85
 
85
86
  _add_package_whitelist_excluders(conduit)
@@ -168,16 +168,15 @@ module ForemanMaintain
168
168
  def validate_hostname?
169
169
  # make sure that the system hostname is the same as the backup
170
170
  config_tarball = file_map[:config_files][:path]
171
- config_files = tarball_file_list(config_tarball)
171
+ tar_cmd = "tar zxf #{config_tarball} etc/httpd/conf/httpd.conf --to-stdout"
172
+ status, httpd_config = execute_with_status(tar_cmd)
172
173
 
173
174
  # Incremental backups sometimes don't include httpd.conf. Since a "base" backup
174
175
  # is restored before an incremental, we can assume that the hostname is checked
175
176
  # during the base backup restore
176
- if config_files.include?('etc/httpd/conf/httpd.conf')
177
- tar_cmd = "tar zxf #{config_tarball} etc/httpd/conf/httpd.conf " \
178
- "--to-stdout | grep ServerName | awk {'print $2'} | tr -d '\"'"
179
- backup_hostname = execute(tar_cmd).chomp
180
- backup_hostname == hostname
177
+ if status == 0
178
+ match = httpd_config.match(/\s*ServerName\s+"*([^ "]+)"*\s*$/)
179
+ match ? match[1] == hostname : false
181
180
  else
182
181
  true
183
182
  end
@@ -209,21 +208,6 @@ module ForemanMaintain
209
208
  def incremental?
210
209
  !!metadata.fetch('incremental', false)
211
210
  end
212
-
213
- private
214
-
215
- def tarball_file_list(tarball)
216
- # accepts tar.gz files only
217
- file_list = []
218
- File.open(tarball, 'rb') do |file|
219
- ::Zlib::GzipReader.wrap(file) do |gz|
220
- ::Gem::Package::TarReader.new(gz) do |tar|
221
- tar.each { |entry| file_list << entry.full_name }
222
- end
223
- end
224
- end
225
- file_list
226
- end
227
211
  end
228
212
  end
229
213
  end
@@ -1,3 +1,3 @@
1
1
  module ForemanMaintain
2
- VERSION = '0.4.9'.freeze
2
+ VERSION = '0.4.10'.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: 0.4.9
4
+ version: 0.4.10
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: 2019-09-12 00:00:00.000000000 Z
11
+ date: 2019-11-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: clamp