From c007919ab4c8717eb749e16a016b94e60d879598 Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Mon, 2 Jun 2014 14:51:28 -0700 Subject: move validation to resource code --- lib/chef/resource/mount.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'lib/chef/resource') diff --git a/lib/chef/resource/mount.rb b/lib/chef/resource/mount.rb index 507c5329e3..4b6a8461e9 100644 --- a/lib/chef/resource/mount.rb +++ b/lib/chef/resource/mount.rb @@ -42,6 +42,7 @@ class Chef @action = :mount @supports = { :remount => false } @allowed_actions.push(:mount, :umount, :remount, :enable, :disable) + @allowed_actions.push(:mount, :umount, :remount, :enable, :disable) @username = nil @password = nil @domain = nil @@ -65,10 +66,15 @@ class Chef def device_type(arg=nil) real_arg = arg.kind_of?(String) ? arg.to_sym : arg + valid_devices = if RUBY_PLATFORM =~ /solaris/i + [ :device ] + else + [ :device, :label, :uuid ] + end set_or_return( :device_type, real_arg, - :equal_to => [ :device, :label, :uuid ] + :equal_to => valid_devices, ) end @@ -76,7 +82,7 @@ class Chef set_or_return( :fstype, arg, - :kind_of => [ String ] + :kind_of => [ String ], ) end -- cgit v1.2.1