|
|
aada13 |
From 4ae6552726c2ee7a28ae97db0d3e84b6ec26a594 Mon Sep 17 00:00:00 2001
|
|
|
aada13 |
From: David Lehman <dlehman@redhat.com>
|
|
|
aada13 |
Date: Fri, 29 Mar 2019 15:38:12 -0400
|
|
|
aada13 |
Subject: [PATCH 13/20] Adapt to older pyudev API for instantiating Device.
|
|
|
aada13 |
|
|
|
aada13 |
---
|
|
|
aada13 |
blivet3/devices/storage.py | 2 +-
|
|
|
aada13 |
blivet3/udev.py | 4 ++--
|
|
|
aada13 |
2 files changed, 3 insertions(+), 3 deletions(-)
|
|
|
aada13 |
|
|
|
aada13 |
diff --git a/blivet3/devices/storage.py b/blivet3/devices/storage.py
|
|
|
aada13 |
index df4e9943..c2ec20fe 100644
|
|
|
aada13 |
--- a/blivet3/devices/storage.py
|
|
|
aada13 |
+++ b/blivet3/devices/storage.py
|
|
|
aada13 |
@@ -294,7 +294,7 @@ class StorageDevice(Device):
|
|
|
aada13 |
raise errors.DeviceError("device has not been created", self.name)
|
|
|
aada13 |
|
|
|
aada13 |
try:
|
|
|
aada13 |
- udev_device = pyudev.Devices.from_device_file(udev.global_udev,
|
|
|
aada13 |
+ udev_device = pyudev.device.Device.from_device_file(udev.global_udev,
|
|
|
aada13 |
self.path)
|
|
|
aada13 |
|
|
|
aada13 |
# from_device_file() does not process exceptions but just propagates
|
|
|
aada13 |
diff --git a/blivet3/udev.py b/blivet3/udev.py
|
|
|
aada13 |
index 227399bc..7c7e8f32 100644
|
|
|
aada13 |
--- a/blivet3/udev.py
|
|
|
aada13 |
+++ b/blivet3/udev.py
|
|
|
aada13 |
@@ -63,9 +63,9 @@ def device_to_dict(device):
|
|
|
aada13 |
def get_device(sysfs_path=None, device_node=None):
|
|
|
aada13 |
try:
|
|
|
aada13 |
if sysfs_path is not None:
|
|
|
aada13 |
- device = pyudev.Devices.from_sys_path(global_udev, sysfs_path)
|
|
|
aada13 |
+ device = pyudev.device.Device.from_sys_path(global_udev, sysfs_path)
|
|
|
aada13 |
elif device_node is not None:
|
|
|
aada13 |
- device = pyudev.Devices.from_device_file(global_udev, device_node)
|
|
|
aada13 |
+ device = pyudev.device.Device.from_device_file(global_udev, device_node)
|
|
|
aada13 |
except pyudev.DeviceNotFoundError as e:
|
|
|
aada13 |
log.error(e)
|
|
|
aada13 |
result = None
|
|
|
aada13 |
--
|
|
|
aada13 |
2.20.1
|
|
|
aada13 |
|