Merge "Avoid pyudev deprecation warnings in python output"

This commit is contained in:
Zuul 2023-02-15 15:59:24 +00:00 committed by Gerrit Code Review
commit 8f9f3a45d2
2 changed files with 5 additions and 5 deletions

View File

@ -1099,7 +1099,7 @@ def get_mpath_from_dm(dm_device):
context = pyudev.Context()
pydev_device = pyudev.Device.from_device_file(context, dm_device)
pydev_device = pyudev.Devices.from_device_file(context, dm_device)
if sysinv_constants.DEVICE_NAME_MPATH in pydev_device.get("DM_NAME", ""):
mpath = pydev_device.get("DM_MPATH", None)
@ -1117,9 +1117,9 @@ def find_boot_device():
# Get the boot partition
try:
part = pyudev.Device.from_device_number(context,
'block',
os.stat('/boot')[stat.ST_DEV])
part = pyudev.Devices.from_device_number(context,
'block',
os.stat('/boot')[stat.ST_DEV])
if part.parent:
boot_device = part.parent.device_node
elif sysinv_constants.DEVICE_NAME_DM in part.device_node:

View File

@ -56,7 +56,7 @@ def get_mpath_from_dm(dm_device):
context = pyudev.Context()
pydev_device = pyudev.Device.from_device_file(context, dm_device)
pydev_device = pyudev.Devices.from_device_file(context, dm_device)
if sysinv_constants.DEVICE_NAME_MPATH in pydev_device.get("DM_NAME", ""):
mpath = pydev_device.get("DM_MPATH", None)