change the logic of sorting
This commit is contained in:
parent
40dedfb707
commit
30badbe1dd
2 changed files with 6 additions and 7 deletions
|
@ -13,7 +13,7 @@ class RhelRpmToCve
|
|||
def list_pkg_names
|
||||
xml[:rpms][:rpm].map do |key|
|
||||
key.first[:rpm]
|
||||
end.sort
|
||||
end
|
||||
end
|
||||
|
||||
def pkg_exists?(pkg_name)
|
||||
|
@ -30,7 +30,8 @@ class RhelRpmToCve
|
|||
:rhel_package_name => pkg_name,
|
||||
:cves => results.map {|cve| cve}
|
||||
}
|
||||
|
||||
else
|
||||
'Package not found.'
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -25,10 +25,8 @@ parser.parse!
|
|||
pkg_name = options[:pkg]
|
||||
rpm_auditer = RhelRpmToCve.new(data_file)
|
||||
|
||||
if rpm_auditer.pkg_exists?(pkg_name)
|
||||
if pkg_name
|
||||
pp rpm_auditer.cves_per_pkg_name(pkg_name)
|
||||
elsif options.key?(:list)
|
||||
puts rpm_auditer.list_pkg_names
|
||||
else
|
||||
puts 'Package not found.'
|
||||
else options.key?(:list)
|
||||
puts rpm_auditer.list_pkg_names.sort
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue