Update users cookbook and poise cookbooks

The poise cookbooks were incompatible with Chef 13
This commit is contained in:
Greg Karékinian
2017-06-16 15:50:13 +02:00
parent f93070c4c0
commit ff3d062c73
65 changed files with 238 additions and 130 deletions

View File

@@ -1,5 +1,16 @@
# Changelog
## v2.8.1
* Fix a missing `require` when using `subclass_providers!` on Chef 12.3.
## v2.8.0
* Chef 13 compatibility.
* Passing a symbol for the parent now works with the `include Poise(:name)`
shortcut.
* Fixed `subclass_providers!` on older versions of Chef.
## v2.7.2
* Test harness fixes for Chef.

View File

@@ -69,7 +69,7 @@ end
# include Poise(container: true)
def Poise(options={})
# Allow passing a class as a shortcut
if options.is_a?(Class)
if options.is_a?(Class) || options.is_a?(Symbol)
options = {parent: options}
end

View File

@@ -99,6 +99,8 @@ module Poise
raise Poise::Error.new("Parser must be a Proc or Symbol: #{parser.inspect}") if parser && !(parser.is_a?(Proc) || parser.is_a?(Symbol))
# Cast to a set at definition time.
forced_keys = Set.new(forced_keys) unless forced_keys.is_a?(Set)
# Never allow name to be called accidentally since it does really wonky things.
forced_keys.add(:name)
# Unlike LWRPBase.attribute, I don't care about Ruby 1.8. Worlds tiniest violin.
define_method(name.to_sym) do |arg=nil, &block|
iv_sym = :"@#{name}"

View File

@@ -14,6 +14,12 @@
# limitations under the License.
#
begin
require 'chef/chef_class'
rescue LoadError
# This space left intentionally blank, fallback is below.
end
require 'poise/error'
require 'poise/helpers/resource_name'
@@ -39,7 +45,12 @@ module Poise
# Deal with the node maps.
node_maps = {}
node_maps['handler map'] = Chef.provider_handler_map if defined?(Chef.provider_handler_map)
node_maps['priority map'] = Chef.provider_priority_map if defined?(Chef.provider_priority_map)
node_maps['priority map'] = if defined?(Chef.provider_priority_map)
Chef.provider_priority_map
else
require 'chef/platform/provider_priority_map'
Chef::Platform::ProviderPriorityMap.instance.send(:priority_map)
end
# Patch anything in the descendants tracker.
Chef::Provider.descendants.each do |provider|
node_maps["#{provider} node map"] = provider.node_map if defined?(provider.node_map)

View File

@@ -16,5 +16,5 @@
module Poise
VERSION = '2.7.2'
VERSION = '2.8.1'
end

File diff suppressed because one or more lines are too long