module

Krikri::PluginHelpers::ZfsCommands

ZfsCommands - command construction and output parsing for community.general.zfs (see plugins/zfs.cr). Pure string plumbing mirroring the real module's Zfs class (create/destroy/set_property/ list_properties/get_property), unit-testable without a ZFS pool.

Class methods

create_command(name : String, properties : Hash(String, String), origin : String | Nil) : Array(String) | Nil

The real module's create(): special-cases volsize (-V) and volblocksize (-b), everything else -o prop=value; -p (parents) for create/clone; snapshot instead of create when the name has an @; clone when origin is set (mutually exclusive with @).

Source
destroy_command(name : String) : Array(String)
Source
exists_command(name : String) : Array(String)
Source
list_properties_command(name : String) : Array(String)
Source
normalize_value(value : JSON::Any) : String

The real module reverses Python bools to "on"/"off" before any command is built; properties arrive here already normalized.

Source
parse_list_properties(output : String) : Array(String)

Parses zfs get -H -p -o property,source all <name> output, keeping only properties whose source is local/received/- (the real module's own filter - creation-only properties are kept via the '-' source so an existing dataset with an unchanged creation-only property doesn't error on a warm run).

Source
property_value_command(name : String, prop : String) : Array(String)
Source
set_property_command(name : String, prop : String, value : String) : Array(String)
Source