diff options
author | Tim Smith <tsmith@chef.io> | 2016-09-14 14:22:04 -0700 |
---|---|---|
committer | Tim Smith <tsmith@chef.io> | 2016-09-14 14:22:04 -0700 |
commit | 67e86dbcf0b702b5a9f2317a6df6ee1df4814038 (patch) | |
tree | 0cd250cc72c5853512e84282b21de98a2a27b90a | |
parent | d4dbd6704b82258113efcea4940360e53cb06360 (diff) | |
download | chef-67e86dbcf0b702b5a9f2317a6df6ee1df4814038.tar.gz |
Add back compatibility with old property names
In yum 3.0 we changed the properties in the documentation, but never threw deprecation notices. Since there was no notice you would have no way to know to use the new properties. We need to add back compatibility with the old names and if we really want to kill them throw a proper deprecation warning.
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r-- | lib/chef/resource/yum_repository.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/chef/resource/yum_repository.rb b/lib/chef/resource/yum_repository.rb index 7b8b8dcb7b..3633f4421b 100644 --- a/lib/chef/resource/yum_repository.rb +++ b/lib/chef/resource/yum_repository.rb @@ -29,7 +29,7 @@ class Chef property :cost, String, regex: /^\d+$/ property :clean_headers, [TrueClass, FalseClass], default: false # deprecated property :clean_metadata, [TrueClass, FalseClass], default: true - property :description, String, regex: /.*/, default: "YUM Repository" + property :description, String, regex: /.*/, default: "Yum Repository" property :enabled, [TrueClass, FalseClass], default: true property :enablegroups, [TrueClass, FalseClass] property :exclude, String, regex: /.*/ @@ -66,11 +66,14 @@ class Chef property :sslclientkey, String, regex: /.*/ property :sslverify, [TrueClass, FalseClass] property :timeout, String, regex: /^\d+$/ - property :options, Hash default_action :create allowed_actions :create, :remove, :make_cache, :add, :delete + + # provide compatibility with the yum cookbook < 3.0 properties + alias_method :url, :baseurl + alias_method :keyurl, :gpgkey end end end |