I think a better way to do this would be to actually check if the specified device is there before trying to check on a replacement device:

```ruby
devices.map! do |device|
  if node_block_devices.include?(device.match(/\/dev\/([a-z]+)$/)[1])
    device
  else
    fixed_device = device.sub("/sd", "/xvd")
    if node_block_devices.include?(fixed_device.match(/\/dev\/([a-z]+)$/)[1])
      fixed_device
    else
      Chef::Log.warn "could not find ephemeral device: #{device}"
    end
  end
end
```