devices/luks2: 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
8abed7677f
commit
84fcf66596
1 changed files with 1 additions and 2 deletions
|
|
@ -15,7 +15,6 @@ Host commands used: `cryptsetup`, `dmsetup`
|
|||
import argparse
|
||||
import contextlib
|
||||
import os
|
||||
import stat
|
||||
import subprocess
|
||||
import sys
|
||||
import uuid
|
||||
|
|
@ -112,7 +111,7 @@ class CryptDeviceService(devices.DeviceService):
|
|||
subpath = os.path.join("mapper", devname)
|
||||
fullpath = os.path.join(devpath, subpath)
|
||||
os.makedirs(os.path.join(devpath, "mapper"), exist_ok=True)
|
||||
os.mknod(fullpath, 0o666 | stat.S_IFBLK, os.makedev(major, minor))
|
||||
self.ensure_device_node(fullpath, major, minor)
|
||||
|
||||
data = {
|
||||
"path": subpath,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue