Skip to content

Commit f15da53

Browse files
committed
add option for early lvm init
Signed-off-by: Zen <[email protected]>
1 parent 7abf862 commit f15da53

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/ugrd/fs/lvm.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = 'desultory'
2-
__version__ = '1.2.2'
2+
__version__ = '1.3.0'
33

44
from zenlib.util import contains
55

@@ -11,6 +11,11 @@ def _process_lvm_multi(self, mapped_name: str, config: dict) -> None:
1111
self['lvm'][mapped_name] = config
1212

1313

14+
@contains('early_lvm')
15+
def early_init_lvm(self) -> None:
16+
""" Returns bash lines to initialize LVM """
17+
return init_lvm(self)
18+
1419
@contains('lvm', "Skipping LVM initialization, no LVM configurations found.")
1520
def init_lvm(self) -> None:
1621
""" Returns bash lines to initialize LVM """

src/ugrd/fs/lvm.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@ binaries = ['pvscan', 'vgscan', 'vgchange', 'lvscan']
33
[imports.config_processing]
44
"ugrd.fs.lvm" = [ "_process_lvm_multi" ]
55

6+
[imports.init_early]
7+
"ugrd.fs.lvm" = [ "early_init_lvm" ]
8+
69
[imports.init_late]
710
"ugrd.fs.lvm" = [ "init_lvm" ]
811

912
[custom_parameters]
13+
early_lvm = "bool" # Run an early lvm scan
1014
lvm = "dict" # lvm configuration dict

0 commit comments

Comments
 (0)