lib/zfs_mgmt.rb in zfs_mgmt-0.4.0 vs lib/zfs_mgmt.rb in zfs_mgmt-0.4.1

- old
+ new

@@ -351,11 +351,11 @@ # snapshot all filesystems configured for snapshotting def self.snapshot_create(noop: false, verbose: false, filter: '.+') dt = DateTime.now zfsget.select { |zfs,props| # must match filter - match_filter?(zfs: zfs, filter: filter) and + match_filter?(zfs, filter) and # snapshot must be on or true ( key_comp?(props,'zfsmgmt:snapshot') or # or snapshot can be recursive and local, but only if the source is local or received ( key_comp?(props,'zfsmgmt:snapshot',['recursive','local']) and key_comp?(props,'zfsmgmt:snapshot@source',['local','received']) ) @@ -617,10 +617,10 @@ "\"#{s}\"" end def self.prop_on?(v) ['true','on'].include?(v) end - def self.match_filter?(zfs:, filter:) + def self.match_filter?(zfs, filter) /#{filter}/ =~ zfs end def self.key_comp?(h,p,v = method(:prop_on?)) #$logger.debug("p:#{p}\th[p]:#{h[p]}\tv:#{v}") return false unless h.has_key?(p)