diff options
author | Tim Smith <tsmith@chef.io> | 2018-04-27 15:41:02 -0700 |
---|---|---|
committer | Tim Smith <tsmith@chef.io> | 2018-04-27 15:41:02 -0700 |
commit | a6aa99e9510ddf4d87d4f081c2d8852647c1f6c0 (patch) | |
tree | 92b8884226e8971415796d3088b287c98bad86b7 | |
parent | a068d3cde6105a591da24d1a5ff35bde26c16214 (diff) | |
download | chef-a6aa99e9510ddf4d87d4f081c2d8852647c1f6c0.tar.gz |
Convert properties in subversion to use propertysubversion
Retained the False = nil behavior which is actually tested in the specs already.
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r-- | lib/chef/resource/subversion.rb | 39 |
1 files changed, 13 insertions, 26 deletions
diff --git a/lib/chef/resource/subversion.rb b/lib/chef/resource/subversion.rb index 02b9da0a42..d67fd22834 100644 --- a/lib/chef/resource/subversion.rb +++ b/lib/chef/resource/subversion.rb @@ -22,40 +22,27 @@ require "chef/resource/scm" class Chef class Resource class Subversion < Chef::Resource::Scm - description "Use the subversion resource to manage source control resources that"\ - " exist in a Subversion repository." + description "Use the subversion resource to manage source control resources that exist in a Subversion repository." allowed_actions :force_export - def initialize(name, run_context = nil) - super - @svn_arguments = "--no-auth-cache" - @svn_info_args = "--no-auth-cache" - end + property :svn_arguments, [String, nil, FalseClass], + description: "The extra arguments that are passed to the Subversion command.", + coerce: proc { |v| v == false ? nil : v }, # coerce false to nil + default: "--no-auth-cache" + + property :svn_info_args, [String, nil, FalseClass], + description: "Use when the svn info command is used by the chef-client and arguments need to be passed. The svn_arguments command does not work when the svn info command is used.", + coerce: proc { |v| v == false ? nil : v }, # coerce false to nil + default: "--no-auth-cache" + + property :svn_binary, String, + description: "The location of the svn binary." # Override exception to strip password if any, so it won't appear in logs and different Chef notifications def custom_exception_message(e) "#{self} (#{defined_at}) had an error: #{e.class.name}: #{svn_password ? e.message.gsub(svn_password, "[hidden_password]") : e.message}" end - - def svn_arguments(arg = nil) - @svn_arguments, arg = nil, nil if arg == false - set_or_return( - :svn_arguments, - arg, - :kind_of => String - ) - end - - def svn_info_args(arg = nil) - @svn_info_args, arg = nil, nil if arg == false - set_or_return( - :svn_info_args, - arg, - :kind_of => String) - end - - property :svn_binary, String end end end |