diff --git a/lib/task_helpers/exports/scan_profiles.rb b/lib/task_helpers/exports/scan_profiles.rb index bd96668490d..cb6d21e7433 100644 --- a/lib/task_helpers/exports/scan_profiles.rb +++ b/lib/task_helpers/exports/scan_profiles.rb @@ -4,11 +4,14 @@ class ScanProfiles def export(options = {}) export_dir = options[:directory] - ScanItemSet.all.each do |p| - next if p.read_only - next if p.members.map { |m| m.slice(:filename) } + scan_item_sets = if options[:all] + ScanItemSet.order(:id).all + else + ScanItemSet.order(:id).where(:read_only => [false, nil]) + end - $log.send(level, "Exporting Scan Profile: #{p.name} (#{p.description})") + scan_item_sets.each do |p| + $log.send(:info, "Exporting Scan Profile: #{p.name} (#{p.description})") profile = ScanItem.get_profile(p.name).first.dup