Merge "Ignore pyudev errors about device number" into stable/train
This commit is contained in:
commit
4c69b3c0c0
@ -371,6 +371,11 @@ def list_all_block_devices(block_type='disk',
|
||||
LOG.warning("Device %(dev)s is inaccessible, skipping... "
|
||||
"Error: %(error)s", {'dev': name, 'error': e})
|
||||
extra = {}
|
||||
except pyudev.DeviceNotFoundByNumberError as e:
|
||||
LOG.warning("Device %(dev)s is not supported by pyudev, "
|
||||
"skipping... Error: %(error)s",
|
||||
{'dev': name, 'error': e})
|
||||
extra = {}
|
||||
else:
|
||||
# TODO(lucasagomes): Since lsblk only supports
|
||||
# returning the short serial we are using
|
||||
|
@ -1629,7 +1629,11 @@ class TestGenericHardwareManager(base.IronicAgentTest):
|
||||
mock_listdir.return_value = [os.path.basename(x)
|
||||
for x in sorted(by_path_map)]
|
||||
mocked_execute.return_value = (BLK_DEVICE_TEMPLATE, '')
|
||||
mocked_udev.side_effect = pyudev.DeviceNotFoundByFileError()
|
||||
mocked_udev.side_effect = [pyudev.DeviceNotFoundByFileError(),
|
||||
pyudev.DeviceNotFoundByNumberError('block',
|
||||
1234),
|
||||
pyudev.DeviceNotFoundByFileError(),
|
||||
pyudev.DeviceNotFoundByFileError()]
|
||||
mocked_dev_vendor.return_value = 'Super Vendor'
|
||||
devices = hardware.list_all_block_devices()
|
||||
expected_devices = [
|
||||
|
Loading…
Reference in New Issue
Block a user