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:
parent
84fcf66596
commit
fb54129317
1 changed files with 1 additions and 2 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue