-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #31210 - add check for diskusage in cp-dir
(cherry picked from commit 9f63e71)
- Loading branch information
1 parent
a27c9cc
commit 83e9a31
Showing
3 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
module Checks | ||
module Disk | ||
class AvailableSpaceCandlepin < ForemanMaintain::Check | ||
metadata do | ||
label :available_space_cp | ||
description 'Check to make sure /var/lib/candlepin has enough space' | ||
tags :pre_upgrade | ||
confine do | ||
feature(:candlepin) && check_min_version('candlepin', '3.1') | ||
end | ||
end | ||
|
||
MAX_USAGE_IN_PERCENT = 90 | ||
|
||
def run | ||
assert(enough_space?, "System has more than #{MAX_USAGE_IN_PERCENT}% space used"\ | ||
" on #{feature(:candlepin).work_dir}.\n"\ | ||
'See https://bugzilla.redhat.com/show_bug.cgi?id=1898605') | ||
end | ||
|
||
def enough_space? | ||
io_obj = ForemanMaintain::Utils::Disk::IODevice.new(feature(:candlepin).work_dir) | ||
io_obj.space_used_in_percent < MAX_USAGE_IN_PERCENT | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters