devices/lvm2.lv: use new ensure_device_node helper

Use the new `DeviceService.ensure_device_node` helper; as a side
effect we won't fail if the device node already exists.
This commit is contained in:
Christian Kellner 2022-11-22 15:52:02 +01:00
parent 84fcf66596
commit fb54129317

View file

@ -30,7 +30,6 @@ Required host tools: lvchange, pvdisplay, lvdisplay
import json
import os
import stat
import subprocess
import sys
import time
@ -198,7 +197,7 @@ class LVService(devices.DeviceService):
fullpath = os.path.join(devpath, devname)
os.makedirs(os.path.join(devpath, vg), exist_ok=True) # type: ignore
os.mknod(fullpath, 0o666 | stat.S_IFBLK, os.makedev(major, minor))
self.ensure_device_node(fullpath, major, minor)
data = {
"path": devname,