From: Vojtech Trefny vtrefny@redhat.com
'pyudev.Device.from_sys_path' and 'pyudev.Device.from_device_file' are deprecated since pyudev 0.18. --- blivet/devices/storage.py | 4 ++-- blivet/udev.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/blivet/devices/storage.py b/blivet/devices/storage.py index d20a52e..7469df3 100644 --- a/blivet/devices/storage.py +++ b/blivet/devices/storage.py @@ -279,8 +279,8 @@ def update_sysfs_path(self): raise errors.DeviceError("device has not been created", self.name)
try: - udev_device = pyudev.Device.from_device_file(udev.global_udev, - self.path) + udev_device = pyudev.Devices.from_device_file(udev.global_udev, + self.path)
# from_device_file() does not process exceptions but just propagates # any errors that are raised. diff --git a/blivet/udev.py b/blivet/udev.py index 7a3e38c..748ab65 100644 --- a/blivet/udev.py +++ b/blivet/udev.py @@ -41,7 +41,7 @@
def get_device(sysfs_path): try: - dev = pyudev.Device.from_sys_path(global_udev, sysfs_path) + dev = pyudev.Devices.from_sys_path(global_udev, sysfs_path) except pyudev.DeviceNotFoundError as e: log.error(e) dev = None