summaryrefslogtreecommitdiff
path: root/lib/chef/resource/user.rb
diff options
context:
space:
mode:
authorNoah Kantrowitz <noah@coderanger.net>2017-04-11 14:17:09 -0700
committerNoah Kantrowitz <noah@coderanger.net>2017-04-11 14:17:09 -0700
commitc08968e5aa066705bddab542ddab4c9b807ccfc3 (patch)
tree4793164d878202b9613acc7252a4eb743bc7c2ed /lib/chef/resource/user.rb
parent2fba7ed9f7d0b05671b6a67580b2f0ec539b60ae (diff)
downloadchef-c08968e5aa066705bddab542ddab4c9b807ccfc3.tar.gz
Put in some temporary hacks for the service and user resource for cases where the tests assumed nillable properties.
This will get cleaned up when they are converted to real properties. Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
Diffstat (limited to 'lib/chef/resource/user.rb')
-rw-r--r--lib/chef/resource/user.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/chef/resource/user.rb b/lib/chef/resource/user.rb
index a1e315ef50..03f2551bf4 100644
--- a/lib/chef/resource/user.rb
+++ b/lib/chef/resource/user.rb
@@ -62,19 +62,21 @@ class Chef
)
end
- def uid(arg = nil)
+ def uid(arg = Chef::NOT_PASSED)
set_or_return(
:uid,
arg,
- :kind_of => [ String, Integer ]
+ :kind_of => [ String, Integer, NilClass ],
+ :coerce => proc {|x| x || nil }
)
end
- def gid(arg = nil)
+ def gid(arg = Chef::NOT_PASSED)
set_or_return(
:gid,
arg,
- :kind_of => [ String, Integer ]
+ :kind_of => [ String, Integer, NilClass ],
+ :coerce => proc {|x| x || nil }
)
end