We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a2252c3 commit 5698bf1Copy full SHA for 5698bf1
1 file changed
src/pyinfra/facts/zfs.py
@@ -34,16 +34,24 @@ def process(self, output):
34
35
36
class ZfsDatasets(FactBase):
37
- @override
38
- def command(self) -> str:
39
- return "zfs get -H all"
40
-
41
@override
42
def requires_command(self) -> str:
43
return "zfs"
44
45
default = dict
46
+ @override
+ def check_preconditions(self, state, host):
+ from pyinfra.facts.server import KernelModules
+
47
+ modules = host.get_fact(KernelModules) or {}
48
+ if "zfs" not in modules:
49
+ return "kernel module 'zfs' is not loaded"
50
51
52
+ def command(self) -> str:
53
+ return "zfs get -H all"
54
55
56
def process(self, output):
57
return _process_zfs_props_table(output)
0 commit comments