Skip to content

Commit

Permalink
Merge branch 'cve_2019-14894-fix-miq-util-error-rescue' into '5.11.z'
Browse files Browse the repository at this point in the history
[miq_memcached.rb] Use AwesomeSpawn::CommandResultError for rescue

See merge request cloudforms/cfme!1080
  • Loading branch information
Fryguy authored and root committed Feb 24, 2020
2 parents 8a7cd9b + 02c5d63 commit ab25bbf
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/miq_memcached.rb
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,16 @@ def self.restart!(opts = {})

def self.killall
MiqUtil.runcmd("killall -9 memcached")
rescue => err
raise unless err.to_s =~ /memcached: no process/
rescue AwesomeSpawn::CommandResultError => err
raise unless err.result.output =~ /memcached: no process/
end

def self.status
begin
res = MiqUtil.runcmd('service memcached status').to_s.chomp
rescue RuntimeError => err
rescue AwesomeSpawn::CommandResultError => err
return false, err.result.output.chomp
rescue => err
return false, err.to_s.chomp
else
return true, res
Expand Down

0 comments on commit ab25bbf

Please sign in to comment.