Merge "Exclude USB block devices by the default"

This commit is contained in:
Jenkins 2016-03-28 16:13:57 +00:00 committed by Gerrit Code Review
commit a75c540b36
1 changed files with 4 additions and 2 deletions

6
agent
View File

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