foreman_maintain 0.6.15 → 0.6.16

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: ddf7d7720cb922e61c0d6245c14929ebb3745307b7b166f89921667a4948d4f1
4
- data.tar.gz: 88c7794cbeb2c13d0bb8e86f4762a516ceec7e7ac48aa03b4c00bcb12bcbe33f
3
+ metadata.gz: '03389eb2ca1e4f48b3fd795cdf443254a873c8823b2142bffdac15a4c940a29c'
4
+ data.tar.gz: 322a7413bb3e65c2d07f4646ee33f6e24cedfa64bfd5a519e91ea6c70ccfa53c
5
5
  SHA512:
6
- metadata.gz: 786f1416f313f3a60d8109edf2c25636770c6592ffb74d921587d23b4da89f1fdd034cb42e610a1df86b54d9118e97b12f7bc8e004019ab664655d577893c1f9
7
- data.tar.gz: 672090585c8fa8b490af89bc9fe14b94aca471ef1457e0553697285e24f20878e2c9743054c6451364418f6d403f129bef6636c7615605a43503843a133b7c83
6
+ metadata.gz: 57661b18eafd6943bd5dfd73bf8314247ee426874b80de2ced9c1cf3341fc5e7d3750554bc349d09ae37d3dba4e5a7d9bf8f938c482f4d22080febc0f03e50f1
7
+ data.tar.gz: ea65edc6f4b121f32aad24069d0f7c68340465cd8d36fd3d1ca507b2e0f1a46bf4c62a9a62c5d965fc7915f6b66b0250ba8c3230de9b52a7114d94286aa91f4d
@@ -0,0 +1,27 @@
1
+ module Checks
2
+ module Disk
3
+ class AvailableSpaceCandlepin < ForemanMaintain::Check
4
+ metadata do
5
+ label :available_space_cp
6
+ description 'Check to make sure /var/lib/candlepin has enough space'
7
+ tags :pre_upgrade
8
+ confine do
9
+ feature(:candlepin) && check_min_version('candlepin', '3.1')
10
+ end
11
+ end
12
+
13
+ MAX_USAGE_IN_PERCENT = 90
14
+
15
+ def run
16
+ assert(enough_space?, "System has more than #{MAX_USAGE_IN_PERCENT}% space used"\
17
+ " on #{feature(:candlepin).work_dir}.\n"\
18
+ 'See https://bugzilla.redhat.com/show_bug.cgi?id=1898605')
19
+ end
20
+
21
+ def enough_space?
22
+ io_obj = ForemanMaintain::Utils::Disk::IODevice.new(feature(:candlepin).work_dir)
23
+ io_obj.space_used_in_percent < MAX_USAGE_IN_PERCENT
24
+ end
25
+ end
26
+ end
27
+ end
@@ -7,6 +7,10 @@ class Features::Candlepin < ForemanMaintain::Feature
7
7
  end
8
8
  end
9
9
 
10
+ def work_dir
11
+ '/var/lib/candlepin'
12
+ end
13
+
10
14
  def services
11
15
  [
12
16
  system_service('tomcat', 20),
@@ -22,6 +22,10 @@ module ForemanMaintain
22
22
  convert_kb_to_mb(execute!("df #{dir}|awk {'print $4'}|tail -1").to_i)
23
23
  end
24
24
 
25
+ def space_used_in_percent
26
+ execute!("df #{dir}|awk {'print $5'}|tail -1").to_i
27
+ end
28
+
25
29
  private
26
30
 
27
31
  # In fio command, --direct option bypass the cache page
@@ -1,3 +1,3 @@
1
1
  module ForemanMaintain
2
- VERSION = '0.6.15'.freeze
2
+ VERSION = '0.6.16'.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.6.15
4
+ version: 0.6.16
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: 2021-01-25 00:00:00.000000000 Z
11
+ date: 2021-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: clamp
@@ -125,6 +125,7 @@ files:
125
125
  - definitions/checks/check_hotfix_installed.rb
126
126
  - definitions/checks/check_tmout.rb
127
127
  - definitions/checks/disk/available_space.rb
128
+ - definitions/checks/disk/available_space_candlepin.rb
128
129
  - definitions/checks/disk/performance.rb
129
130
  - definitions/checks/env_proxy.rb
130
131
  - definitions/checks/foreman/check_checkpoint_segments.rb
@@ -406,7 +407,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
406
407
  - !ruby/object:Gem::Version
407
408
  version: '0'
408
409
  requirements: []
409
- rubygems_version: 3.0.8
410
+ rubygems_version: 3.0.3
410
411
  signing_key:
411
412
  specification_version: 4
412
413
  summary: Foreman maintenance tool belt