Update the mediawiki cookbook and upstream cookbooks
Compatibility with Chef 14
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
#
|
||||
# Author:: Seth Chisamore (<schisamo@chef.io>)
|
||||
# Cookbook:: windows
|
||||
# Library:: helper
|
||||
# Library:: windows_helper
|
||||
#
|
||||
# Copyright:: 2011-2017, Chef Software, Inc.
|
||||
# Copyright:: 2011-2018, Chef Software, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
@@ -20,6 +20,9 @@
|
||||
require 'uri'
|
||||
require 'Win32API' if Chef::Platform.windows?
|
||||
require 'chef/exceptions'
|
||||
require 'openssl'
|
||||
require 'chef/mixin/powershell_out'
|
||||
require 'chef/util/path_helper'
|
||||
|
||||
module Windows
|
||||
module Helper
|
||||
@@ -30,6 +33,7 @@ module Windows
|
||||
# returns windows friendly version of the provided path,
|
||||
# ensures backslashes are used everywhere
|
||||
def win_friendly_path(path)
|
||||
Chef::Log.warn('The win_friendly_path helper has been deprecated and will be removed from the next major release of the windows cookbook. Please update any cookbooks using this helper to instead require `chef/util/path_helper` and then use `Chef::Util::PathHelper.cleanpath`.')
|
||||
path.gsub(::File::SEPARATOR, ::File::ALT_SEPARATOR || '\\') if path
|
||||
end
|
||||
|
||||
@@ -47,16 +51,6 @@ module Windows
|
||||
end
|
||||
end
|
||||
|
||||
# Create a feature provider dependent value object.
|
||||
# mainly created becasue Windows Feature names are
|
||||
# different based on whether dism.exe or servicemanagercmd.exe
|
||||
# is used for installation
|
||||
def value_for_feature_provider(provider_hash)
|
||||
p = Chef::Platform.find_provider_for_node(node, :windows_feature)
|
||||
key = p.to_s.downcase.split('::').last
|
||||
provider_hash[key] || provider_hash[key.to_sym]
|
||||
end
|
||||
|
||||
# singleton instance of the Windows Version checker
|
||||
def win_version
|
||||
@win_version ||= Windows::Version.new
|
||||
@@ -88,7 +82,7 @@ module Windows
|
||||
cache_file_path = source
|
||||
end
|
||||
|
||||
windows_path ? win_friendly_path(cache_file_path) : cache_file_path
|
||||
windows_path ? Chef::Util::PathHelper.cleanpath(cache_file_path) : cache_file_path
|
||||
end
|
||||
end
|
||||
|
||||
@@ -103,7 +97,7 @@ module Windows
|
||||
buf.strip
|
||||
end
|
||||
|
||||
def is_package_installed?(package_name) # rubocop:disable Style/PredicateName
|
||||
def is_package_installed?(package_name) # rubocop:disable Naming/PredicateName
|
||||
installed_packages.include?(package_name)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user