summaryrefslogtreecommitdiff
path: root/lib/chef/provider
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2016-03-10 11:02:23 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2016-03-10 11:02:23 -0800
commit6c99e45209183f006d02a96e6fc7908e69836d78 (patch)
tree2e7a1aa80dd218a551678d6ac08a11e7503093fb /lib/chef/provider
parent615f2889ac732ac8435f69f8c9dfdae6f778edb6 (diff)
downloadchef-6c99e45209183f006d02a96e6fc7908e69836d78.tar.gz
s/escape_glob/escape_glob_dir/lcg/fix-escape-glob
Removes all remaining references to the deprecated escape_glob helper routine.
Diffstat (limited to 'lib/chef/provider')
-rw-r--r--lib/chef/provider/deploy.rb2
-rw-r--r--lib/chef/provider/deploy/revision.rb4
-rw-r--r--lib/chef/provider/package/freebsd/pkg.rb2
-rw-r--r--lib/chef/provider/package/portage.rb4
-rw-r--r--lib/chef/provider/remote_directory.rb2
-rw-r--r--lib/chef/provider/service/gentoo.rb2
-rw-r--r--lib/chef/provider/service/insserv.rb2
-rw-r--r--lib/chef/provider/service/macosx.rb2
-rw-r--r--lib/chef/provider/user/dscl.rb2
9 files changed, 11 insertions, 11 deletions
diff --git a/lib/chef/provider/deploy.rb b/lib/chef/provider/deploy.rb
index 7274ab2e8f..4c758033ac 100644
--- a/lib/chef/provider/deploy.rb
+++ b/lib/chef/provider/deploy.rb
@@ -242,7 +242,7 @@ class Chef
end
def all_releases
- Dir.glob(Chef::Util::PathHelper.escape_glob(@new_resource.deploy_to) + "/releases/*").sort
+ Dir.glob(Chef::Util::PathHelper.escape_glob_dir(@new_resource.deploy_to) + "/releases/*").sort
end
def update_cached_repo
diff --git a/lib/chef/provider/deploy/revision.rb b/lib/chef/provider/deploy/revision.rb
index 9e2bb94f5b..f61e439486 100644
--- a/lib/chef/provider/deploy/revision.rb
+++ b/lib/chef/provider/deploy/revision.rb
@@ -44,7 +44,7 @@ class Chef
known_releases = sorted_releases
- Dir["#{Chef::Util::PathHelper.escape_glob(new_resource.deploy_to)}/releases/*"].each do |release_dir|
+ Dir["#{Chef::Util::PathHelper.escape_glob_dir(new_resource.deploy_to)}/releases/*"].each do |release_dir|
unless known_releases.include?(release_dir)
converge_by("Remove unknown release in #{release_dir}") do
FileUtils.rm_rf(release_dir)
@@ -87,7 +87,7 @@ class Chef
end
def sorted_releases_from_filesystem
- Dir.glob(Chef::Util::PathHelper.escape_glob(new_resource.deploy_to) + "/releases/*").sort_by { |d| ::File.ctime(d) }
+ Dir.glob(Chef::Util::PathHelper.escape_glob_dir(new_resource.deploy_to) + "/releases/*").sort_by { |d| ::File.ctime(d) }
end
def load_cache
diff --git a/lib/chef/provider/package/freebsd/pkg.rb b/lib/chef/provider/package/freebsd/pkg.rb
index b42bd62c61..78d9449454 100644
--- a/lib/chef/provider/package/freebsd/pkg.rb
+++ b/lib/chef/provider/package/freebsd/pkg.rb
@@ -88,7 +88,7 @@ class Chef
end
def file_candidate_version_path
- Dir[Chef::Util::PathHelper.escape_glob("#{@new_resource.source}/#{@current_resource.package_name}") + "*"][-1].to_s
+ Dir[Chef::Util::PathHelper.escape_glob_dir("#{@new_resource.source}/#{@current_resource.package_name}") + "*"][-1].to_s
end
def file_candidate_version
diff --git a/lib/chef/provider/package/portage.rb b/lib/chef/provider/package/portage.rb
index 7127fa723f..7c52e43bff 100644
--- a/lib/chef/provider/package/portage.rb
+++ b/lib/chef/provider/package/portage.rb
@@ -37,8 +37,8 @@ class Chef
category, pkg = %r{^#{PACKAGE_NAME_PATTERN}$}.match(@new_resource.package_name)[1, 2]
- globsafe_category = category ? Chef::Util::PathHelper.escape_glob(category) : nil
- globsafe_pkg = Chef::Util::PathHelper.escape_glob(pkg)
+ globsafe_category = category ? Chef::Util::PathHelper.escape_glob_dir(category) : nil
+ globsafe_pkg = Chef::Util::PathHelper.escape_glob_dir(pkg)
possibilities = Dir["/var/db/pkg/#{globsafe_category || "*"}/#{globsafe_pkg}-*"].map { |d| d.sub(%r{/var/db/pkg/}, "") }
versions = possibilities.map do |entry|
if entry =~ %r{[^/]+/#{Regexp.escape(pkg)}\-(\d[\.\d]*((_(alpha|beta|pre|rc|p)\d*)*)?(-r\d+)?)}
diff --git a/lib/chef/provider/remote_directory.rb b/lib/chef/provider/remote_directory.rb
index b592b13ccf..e3bc579107 100644
--- a/lib/chef/provider/remote_directory.rb
+++ b/lib/chef/provider/remote_directory.rb
@@ -104,7 +104,7 @@ class Chef
#
def purge_unmanaged_files
if purge
- Dir.glob(::File.join(Chef::Util::PathHelper.escape_glob(path), "**", "*"), ::File::FNM_DOTMATCH).sort!.reverse!.each do |file|
+ Dir.glob(::File.join(Chef::Util::PathHelper.escape_glob_dir(path), "**", "*"), ::File::FNM_DOTMATCH).sort!.reverse!.each do |file|
# skip '.' and '..'
next if [".", ".."].include?(Pathname.new(file).basename().to_s)
diff --git a/lib/chef/provider/service/gentoo.rb b/lib/chef/provider/service/gentoo.rb
index 66f2f10f23..56064bc03a 100644
--- a/lib/chef/provider/service/gentoo.rb
+++ b/lib/chef/provider/service/gentoo.rb
@@ -33,7 +33,7 @@ class Chef::Provider::Service::Gentoo < Chef::Provider::Service::Init
super
@current_resource.enabled(
- Dir.glob("/etc/runlevels/**/#{Chef::Util::PathHelper.escape_glob(@current_resource.service_name)}").any? do |file|
+ Dir.glob("/etc/runlevels/**/#{Chef::Util::PathHelper.escape_glob_dir(@current_resource.service_name)}").any? do |file|
@found_script = true
exists = ::File.exists? file
readable = ::File.readable? file
diff --git a/lib/chef/provider/service/insserv.rb b/lib/chef/provider/service/insserv.rb
index 7f92ef1eb4..76b2ee7477 100644
--- a/lib/chef/provider/service/insserv.rb
+++ b/lib/chef/provider/service/insserv.rb
@@ -36,7 +36,7 @@ class Chef
super
# Look for a /etc/rc.*/SnnSERVICE link to signify that the service would be started in a runlevel
- if Dir.glob("/etc/rc**/S*#{Chef::Util::PathHelper.escape_glob(current_resource.service_name)}").empty?
+ if Dir.glob("/etc/rc**/S*#{Chef::Util::PathHelper.escape_glob_dir(current_resource.service_name)}").empty?
current_resource.enabled false
else
current_resource.enabled true
diff --git a/lib/chef/provider/service/macosx.rb b/lib/chef/provider/service/macosx.rb
index 63485903c3..e6e57e4695 100644
--- a/lib/chef/provider/service/macosx.rb
+++ b/lib/chef/provider/service/macosx.rb
@@ -236,7 +236,7 @@ class Chef
plists = PLIST_DIRS.inject([]) do |results, dir|
edir = ::File.expand_path(dir)
entries = Dir.glob(
- "#{edir}/*#{Chef::Util::PathHelper.escape_glob(@current_resource.service_name)}*.plist"
+ "#{edir}/*#{Chef::Util::PathHelper.escape_glob_dir(@current_resource.service_name)}*.plist"
)
entries.any? ? results << entries : results
end
diff --git a/lib/chef/provider/user/dscl.rb b/lib/chef/provider/user/dscl.rb
index fecfb73e2d..e933bf9dc0 100644
--- a/lib/chef/provider/user/dscl.rb
+++ b/lib/chef/provider/user/dscl.rb
@@ -331,7 +331,7 @@ user password using shadow hash.")
src = current_resource.home
FileUtils.mkdir_p(new_resource.home)
- files = ::Dir.glob("#{Chef::Util::PathHelper.escape_glob(src)}/*", ::File::FNM_DOTMATCH) - ["#{src}/.", "#{src}/.."]
+ files = ::Dir.glob("#{Chef::Util::PathHelper.escape_glob_dir(src)}/*", ::File::FNM_DOTMATCH) - ["#{src}/.", "#{src}/.."]
::FileUtils.mv(files, new_resource.home, :force => true)
::FileUtils.rmdir(src)
::FileUtils.chown_R(new_resource.username, new_resource.gid.to_s, new_resource.home)