Browse Source

Merge "Exclude USB block devices by the default"

Jenkins 3 years ago
parent
commit
a75c540b36
1 changed files with 4 additions and 2 deletions
  1. 4
    2
      agent

+ 4
- 2
agent View File

@@ -714,14 +714,16 @@ class NodeAgent
714 714
       if STORAGE_CODES.include?(properties['MAJOR'].to_i)
715 715
         @logger.debug("Device #{devname} seems to be appropriate")
716 716
         # Exclude LVM volumes (in CentOS - 253, in Ubuntu - 252) using additional check
717
-        unless properties['DEVPATH'].include?('virtual/block/dm')
717
+        # Exclude any storage device connected through USB by the default
718
+        next if properties['DEVPATH'].include?('virtual/block/dm') ||
719
+                (properties['ID_BUS'] == 'usb' &&
720
+                 !@settings.has_key?("report_usb_block_devices"))
718 721
           @blocks << {
719 722
             :name => basename_dir,
720 723
             :disk => _disk_path_by_name(devname) || devname,
721 724
             :extra => _disk_id_by_name(devname) || [],
722 725
             :removable => removable,
723 726
           }
724
-        end
725 727
       end
726 728
     end
727 729
     @logger.debug("Final list of physical devices is: #{@blocks.inspect}")

Loading…
Cancel
Save