Skip to content

Commit

Permalink
Refs #26050 - few method changes
Browse files Browse the repository at this point in the history
  • Loading branch information
upadhyeammit committed May 21, 2019
1 parent 8624c77 commit 096cdb8
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions definitions/checks/yum_exclude.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ class Checks::YumExclude < ForemanMaintain::Check
end

def run
assert(exclude_set?, 'The /etc/yum.conf has exclude list configured as below,'\
"\n #{yum_exclude}"\
assert(!exclude_set?, 'The /etc/yum.conf has exclude list configured as below,'\
"\n #{grep_yum_exclude[1]}"\
"\nUnset this as it can cause yum update or upgrade failures !")
end

def exclude_set?
yum_exclude == 'exclude=' || yum_exclude == 'exclude ='
return true if grep_yum_exclude[1] =~ /^exclude\s*=\s*\S+/

false
end

def yum_exclude
execute!('grep -w exclude /etc/yum.conf')
rescue ForemanMaintain::Error::ExecutionError
'exclude='
def grep_yum_exclude
execute_with_status('grep -w exclude /etc/yum.conf')
end
end

0 comments on commit 096cdb8

Please sign in to comment.