From 1bea418a07388700efe5287389d8ce4f8ee89966 Mon Sep 17 00:00:00 2001 From: "Erin G. Roberts" Date: Mon, 24 Apr 2023 14:32:24 -0400 Subject: [PATCH] add zfs attribute defaultuserquota --- REFERENCE.md | 4 ++++ lib/puppet/provider/zfs/zfs.rb | 6 +++--- lib/puppet/type/zfs.rb | 4 ++++ spec/unit/provider/zfs/zfs_spec.rb | 11 ++++++----- spec/unit/type/zfs_spec.rb | 2 +- 5 files changed, 18 insertions(+), 9 deletions(-) diff --git a/REFERENCE.md b/REFERENCE.md index 070f274..de2f13c 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -67,6 +67,10 @@ The copies property. Valid values are `1`, `2`, `3`. The dedup property. Valid values are `on`, `off`. +##### `defaultuserquota` + +The defaultuserquota property. Valid values are ``, `none`. + ##### `devices` The devices property. Valid values are `on`, `off`. diff --git a/lib/puppet/provider/zfs/zfs.rb b/lib/puppet/provider/zfs/zfs.rb index 976d9bf..15670f5 100644 --- a/lib/puppet/provider/zfs/zfs.rb +++ b/lib/puppet/provider/zfs/zfs.rb @@ -76,9 +76,9 @@ def container_property end [:aclinherit, :atime, :canmount, :checksum, - :compression, :copies, :dedup, :devices, :exec, :logbias, - :mountpoint, :nbmand, :primarycache, :quota, :readonly, - :recordsize, :refquota, :refreservation, :reservation, + :compression, :copies, :dedup, :defaultuserquota, :devices, + :exec, :logbias, :mountpoint, :nbmand, :primarycache, :quota, + :readonly, :recordsize, :refquota, :refreservation, :reservation, :secondarycache, :setuid, :sharenfs, :sharesmb, :snapdir, :sync, :version, :volsize, :vscan, :xattr].each do |field| define_method(field) do diff --git a/lib/puppet/type/zfs.rb b/lib/puppet/type/zfs.rb index 7ea6430..3db8f67 100644 --- a/lib/puppet/type/zfs.rb +++ b/lib/puppet/type/zfs.rb @@ -56,6 +56,10 @@ module Puppet desc 'The dedup property. Valid values are `on`, `off`.' end + newproperty(:defaultuserquota) do + desc 'The defaultuserquota property. Valid values are ``, `none`.' + end + newproperty(:devices) do desc 'The devices property. Valid values are `on`, `off`.' end diff --git a/spec/unit/provider/zfs/zfs_spec.rb b/spec/unit/provider/zfs/zfs_spec.rb index e8cefa1..21ed14e 100644 --- a/spec/unit/provider/zfs/zfs_spec.rb +++ b/spec/unit/provider/zfs/zfs_spec.rb @@ -91,11 +91,12 @@ describe 'zfs properties' do [:aclinherit, :aclmode, :atime, :canmount, :checksum, - :compression, :copies, :dedup, :devices, :exec, :logbias, - :mountpoint, :nbmand, :overlay, :primarycache, :quota, :readonly, - :recordsize, :refquota, :refreservation, :reservation, - :secondarycache, :setuid, :shareiscsi, :sharenfs, :sharesmb, - :snapdir, :version, :volsize, :vscan, :xattr].each do |prop| + :compression, :copies, :dedup, :defaultuserquota, + :devices, :exec, :logbias, :mountpoint, :nbmand, :overlay, + :primarycache, :quota, :readonly, :recordsize, :refquota, + :refreservation, :reservation, :secondarycache, :setuid, + :shareiscsi, :sharenfs, :sharesmb, :snapdir, :version, + :volsize, :vscan, :xattr].each do |prop| it "gets #{prop}" do expect(provider).to receive(:zfs).with(:get, '-H', '-o', 'value', prop, name).and_return("value\n") diff --git a/spec/unit/type/zfs_spec.rb b/spec/unit/type/zfs_spec.rb index 13afbbf..deda1ce 100644 --- a/spec/unit/type/zfs_spec.rb +++ b/spec/unit/type/zfs_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe Puppet::Type.type(:zfs) do - properties = [:ensure, :mountpoint, :compression, :copies, :overlay, :quota, :reservation, :sharenfs, :snapdir, :sync] + properties = [:ensure, :mountpoint, :compression, :copies, :overlay, :quota, :defaultuserquota, :reservation, :sharenfs, :snapdir, :sync] properties.each do |property| it "has a #{property} property" do