Skip to content

Commit

Permalink
Proper check if new version is available for cert packages
Browse files Browse the repository at this point in the history
  • Loading branch information
iNecas committed Sep 16, 2013
1 parent ca16c43 commit 8c8c706
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/puppet/provider/katello_ssl_tool.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,14 @@ def deploy!
end

def new_version_available?
current_version = version_from_name(`rpm -q #{rpmfile_base_name}`)
latest_version = version_from_name(`rpm -pq #{rpmfile}`)
(latest_version <=> current_version) > 0
if File.exists?(rpmfile)
current_version = version_from_name(`rpm -q #{rpmfile_base_name}`)
latest_version = version_from_name(`rpm -pq #{rpmfile}`)
(latest_version <=> current_version) > 0
else
`yum check-update #{rpmfile_base_name} &>/dev/null`
$?.exitstatus == 100
end
end

def version_from_name(rpmname)
Expand Down

0 comments on commit 8c8c706

Please sign in to comment.