summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2018-04-30 09:26:16 -0700
committerGitHub <noreply@github.com>2018-04-30 09:26:16 -0700
commitcbe083de65e1cd7b1909266837cb662dcadbf1f5 (patch)
treee737757837e0f56d0d390380b257169bd37647e4
parent4a053a756e8ba4ab9d1fcad384396f465eb1cee7 (diff)
parenta6aa99e9510ddf4d87d4f081c2d8852647c1f6c0 (diff)
downloadchef-cbe083de65e1cd7b1909266837cb662dcadbf1f5.tar.gz
Merge pull request #7200 from chef/subversion
Convert properties in subversion to use property
-rw-r--r--lib/chef/resource/subversion.rb39
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