mirror of
https://github.com/inspec/inspec
synced 2025-02-17 06:28:40 +00:00
bugfix: rpm does not return exit code if package is not available, work around that
This commit is contained in:
parent
86bdb9903b
commit
022ec31529
1 changed files with 3 additions and 1 deletions
|
@ -89,7 +89,9 @@ end
|
|||
class Rpm < PkgManagement
|
||||
def info(package_name)
|
||||
cmd = @vulcano.command("rpm -qia #{package_name}")
|
||||
return nil if cmd.exit_status.to_i != 0
|
||||
# CentOS does not return an error code if the package is not installed,
|
||||
# therefore we need to check for emptyness
|
||||
return nil if cmd.exit_status.to_i != 0 || cmd.stdout.chomp.empty?
|
||||
params = SimpleConfig.new(
|
||||
cmd.stdout.chomp,
|
||||
assignment_re: /^\s*([^:]*?)\s*:\s*(.*?)\s*$/,
|
||||
|
|
Loading…
Add table
Reference in a new issue