foreman_maintain 1.0.2 → 1.0.3

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: 65892e9e2d93db0e9b4793b00743b75474ce7900cb425abe85e006cf7b6190ad
4
- data.tar.gz: ee0ddd71d2dbb04805e080c60bff8a4b943122d6dd0e4c96b14401cf731fe7bf
3
+ metadata.gz: '092ba2224bd80eeef29cbcc522cf6ef3a438094125e8a4ad87e0c99281fdd251'
4
+ data.tar.gz: 0f71a35dc5325391b51a9648cd633ccf681eae203dfa9b49e6626e2b1bd6b602
5
5
  SHA512:
6
- metadata.gz: df314cd4b969b7e9a71dfc3255ee6bd54ce598a42b26596ec499b866385b0838f8c455a4adc5e74acafbfd7cc733c63f072ada1d2d2af5b5473f8ba329ab77a2
7
- data.tar.gz: 41f7380430eb839081e4fa70610b0ef87b733d08acfaa3573a8a4750d2e4880e650a91e415c4a04e4be9c28e828dd4e2c9d9245839a4891c50690247c62697a5
6
+ metadata.gz: 5589f427186e871ca4b0fbaba47ac450962ef2a91f72c33209b2b9f67d1c354e84c9f407cb47b686ef9867a82cbfdbc6360c1e312ba41021bc16fa08fa5e7e0c
7
+ data.tar.gz: 6f2f77e8fe631dee53dd3e9476868d76063d8f1c4fb4b2533c332ca88ab16af0b587901258fe4ab7558bf9fce942263b5717c7ef2717a7c0ea428de266a36991
@@ -46,9 +46,11 @@ class Checks::CheckHotfixInstalled < ForemanMaintain::Check
46
46
  def installed_packages
47
47
  packages = []
48
48
  repoquery_cmd = execute!('which repoquery')
49
- IO.popen([repoquery_cmd, '-a', '--installed', '--qf', '%{ui_from_repo} %{nvra}']) do |io|
49
+ query_format = '%{ui_from_repo} %{name}-%{evr}.%{arch}'
50
+ IO.popen([repoquery_cmd, '-a', '--installed', '--qf', query_format]) do |io|
50
51
  io.each do |line|
51
52
  repo, pkg = line.chomp.split
53
+ next if repo.nil? || pkg.nil?
52
54
  packages << pkg if /satellite|rhscl/ =~ repo[1..-1].downcase
53
55
  end
54
56
  end
@@ -6,12 +6,12 @@ module Checks::ForemanProxy
6
6
  tags :default
7
7
  confine do
8
8
  feature(:satellite) && feature(:foreman_proxy) &&
9
- feature(:foreman_proxy).features.include?('tftp') && non_zero_token_duration?
9
+ feature(:foreman_proxy).features.include?('tftp')
10
10
  end
11
11
  end
12
12
 
13
13
  def run
14
- if Dir.exist?(tftp_boot_directory)
14
+ if non_zero_token_duration? && Dir.exist?(tftp_boot_directory)
15
15
  files = old_files_from_tftp_boot
16
16
  assert(files.empty?,
17
17
  'There are old initrd and vmlinuz files present in tftp',
@@ -29,7 +29,7 @@ module Checks::ForemanProxy
29
29
  end.compact
30
30
  end
31
31
 
32
- def self.non_zero_token_duration?
32
+ def non_zero_token_duration?
33
33
  lookup_token_duration != 0
34
34
  end
35
35
 
@@ -38,10 +38,10 @@ module Checks::ForemanProxy
38
38
  end
39
39
 
40
40
  def token_duration
41
- @token_duration ||= self.class.lookup_token_duration
41
+ @token_duration ||= lookup_token_duration
42
42
  end
43
43
 
44
- def self.lookup_token_duration
44
+ def lookup_token_duration
45
45
  data = feature(:foreman_database). \
46
46
  query("select s.value, s.default from settings s \
47
47
  where category IN ('Setting::Provisioning','Setting') \
@@ -5,7 +5,9 @@ module Procedures::Puppet
5
5
  end
6
6
 
7
7
  def run
8
- execute!('foreman-rake purge:puppet')
8
+ if feature(:foreman_server)
9
+ execute!('foreman-rake purge:puppet')
10
+ end
9
11
  execute!('rm -r ' + files_to_purge.join(' '))
10
12
  end
11
13
 
@@ -14,6 +14,7 @@ module ForemanMaintain::Scenarios
14
14
  add_step(Checks::CheckPuppetCapsules) if server?
15
15
  add_step(Procedures::Puppet::RemovePuppet)
16
16
  add_step(Procedures::Puppet::RemovePuppetData) if context.get(:remove_data)
17
+ add_step(Procedures::Service::Restart)
17
18
  end
18
19
  end
19
20
  end
@@ -1,3 +1,3 @@
1
1
  module ForemanMaintain
2
- VERSION = '1.0.2'.freeze
2
+ VERSION = '1.0.3'.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.2
4
+ version: 1.0.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: 2022-01-26 00:00:00.000000000 Z
11
+ date: 2022-02-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: clamp