Use new shiny Devices class instead of old ugly Device
The pyudev library migrated teh Device class to Devices and while all the old methods still work, it's marked for removal in one of the next releases. Updating to the new class will probably prevent some headaches. Change-Id: I4a4c7ce7b5139af9c8886a759979d5b3f5bf8b8d
This commit is contained in:
parent
7883102db0
commit
453485bf0a
@ -33,7 +33,7 @@ def get_devices_wwn(devices, module):
|
||||
for device in devices:
|
||||
name = '/dev/' + device
|
||||
try:
|
||||
udev = pyudev.Device.from_device_file(context, name)
|
||||
udev = pyudev.Devices.from_device_file(context, name)
|
||||
except (ValueError, EnvironmentError, pyudev.DeviceNotFoundError) as e:
|
||||
module.warn('Device %(dev)s is inaccessible, skipping... '
|
||||
'Error: %(error)s' % {'dev': name, 'error': e})
|
||||
|
Loading…
x
Reference in New Issue
Block a user