summaryrefslogtreecommitdiff
path: root/lib/chef/provider
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2016-02-18 18:39:11 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2016-02-18 18:39:11 -0800
commit6077b99f6ad1bc9a082f575f3818e69f05d8c8dc (patch)
treeae132bad653614ae549e6301a01f991f8cf5cb5b /lib/chef/provider
parent8f9a0dbd88de3014161bebfef7a02821e0010a37 (diff)
downloadchef-6077b99f6ad1bc9a082f575f3818e69f05d8c8dc.tar.gz
deal with 0.37.2 renamed cops
252 Style/TrailingCommaInLiteral 84 Style/TrailingCommaInArguments 15 Style/SpaceAroundKeyword -- 351 Total We already dealt with SpaceAroundKeyword under its old name SpaceBeforeModifierKeyword, it looks like it got stricter about spaces after keywords. TrailingComma also got split, and it looks like the TrailingCommaInArguments behavior is new?
Diffstat (limited to 'lib/chef/provider')
-rw-r--r--lib/chef/provider/execute.rb2
-rw-r--r--lib/chef/provider/group.rb2
-rw-r--r--lib/chef/provider/group/dscl.rb2
-rw-r--r--lib/chef/provider/launchd.rb4
-rw-r--r--lib/chef/provider/link.rb2
-rw-r--r--lib/chef/provider/mount/mount.rb2
-rw-r--r--lib/chef/provider/osx_profile.rb6
-rw-r--r--lib/chef/provider/package/chocolatey.rb2
-rw-r--r--lib/chef/provider/package/pacman.rb2
-rw-r--r--lib/chef/provider/package/paludis.rb4
-rw-r--r--lib/chef/provider/package/portage.rb6
-rw-r--r--lib/chef/provider/service/gentoo.rb2
-rw-r--r--lib/chef/provider/service/macosx.rb4
-rw-r--r--lib/chef/provider/user/dscl.rb2
14 files changed, 21 insertions, 21 deletions
diff --git a/lib/chef/provider/execute.rb b/lib/chef/provider/execute.rb
index 45f0ad5488..4e7d8e1454 100644
--- a/lib/chef/provider/execute.rb
+++ b/lib/chef/provider/execute.rb
@@ -117,7 +117,7 @@ class Chef
def sentinel_file
Pathname.new(Chef::Util::PathHelper.cleanpath(
- ( cwd && creates_relative? ) ? ::File.join(cwd, creates) : creates
+ ( cwd && creates_relative? ) ? ::File.join(cwd, creates) : creates,
))
end
end
diff --git a/lib/chef/provider/group.rb b/lib/chef/provider/group.rb
index efcbef8014..fcae24f8f9 100644
--- a/lib/chef/provider/group.rb
+++ b/lib/chef/provider/group.rb
@@ -90,7 +90,7 @@ class Chef
@change_desc << "change gid #{@current_resource.gid} to #{@new_resource.gid}"
end
- if(@new_resource.append)
+ if @new_resource.append
missing_members = []
@new_resource.members.each do |member|
next if has_current_group_member?(member)
diff --git a/lib/chef/provider/group/dscl.rb b/lib/chef/provider/group/dscl.rb
index 08661f21b8..00b4ce2b93 100644
--- a/lib/chef/provider/group/dscl.rb
+++ b/lib/chef/provider/group/dscl.rb
@@ -72,7 +72,7 @@ class Chef
def get_free_gid(search_limit = 1000)
gid = nil; next_gid_guess = 200
groups_gids = safe_dscl("list /Groups gid")
- while(next_gid_guess < search_limit + 200)
+ while next_gid_guess < search_limit + 200
if groups_gids =~ Regexp.new("#{Regexp.escape(next_gid_guess.to_s)}\n")
next_gid_guess += 1
else
diff --git a/lib/chef/provider/launchd.rb b/lib/chef/provider/launchd.rb
index 41c61eafde..c58d4bfa34 100644
--- a/lib/chef/provider/launchd.rb
+++ b/lib/chef/provider/launchd.rb
@@ -40,7 +40,7 @@ class Chef
:path,
:source,
:session_type,
- :type
+ :type,
]
def load_current_resource
@@ -51,7 +51,7 @@ class Chef
def gen_path_from_type
types = {
"daemon" => "/Library/LaunchDaemons/#{label}.plist",
- "agent" => "/Library/LaunchAgents/#{label}.plist"
+ "agent" => "/Library/LaunchAgents/#{label}.plist",
}
types[type]
end
diff --git a/lib/chef/provider/link.rb b/lib/chef/provider/link.rb
index d184094bbb..85c46ada98 100644
--- a/lib/chef/provider/link.rb
+++ b/lib/chef/provider/link.rb
@@ -52,7 +52,7 @@ class Chef
if file_class.symlink?(@current_resource.target_file)
@current_resource.link_type(:symbolic)
@current_resource.to(
- canonicalize(file_class.readlink(@current_resource.target_file))
+ canonicalize(file_class.readlink(@current_resource.target_file)),
)
else
@current_resource.link_type(:hard)
diff --git a/lib/chef/provider/mount/mount.rb b/lib/chef/provider/mount/mount.rb
index 635a4f6ea2..265911b54c 100644
--- a/lib/chef/provider/mount/mount.rb
+++ b/lib/chef/provider/mount/mount.rb
@@ -44,7 +44,7 @@ class Chef
# only check for existence of non-remote devices
if device_should_exist? && !::File.exists?(device_real)
raise Chef::Exceptions::Mount, "Device #{@new_resource.device} does not exist"
- elsif( @new_resource.mount_point != "none" && !::File.exists?(@new_resource.mount_point) )
+ elsif @new_resource.mount_point != "none" && !::File.exists?(@new_resource.mount_point)
raise Chef::Exceptions::Mount, "Mount point #{@new_resource.mount_point} does not exist"
end
return true
diff --git a/lib/chef/provider/osx_profile.rb b/lib/chef/provider/osx_profile.rb
index 3747a917fa..f232dede83 100644
--- a/lib/chef/provider/osx_profile.rb
+++ b/lib/chef/provider/osx_profile.rb
@@ -40,7 +40,7 @@ class Chef
all_profiles = get_installed_profiles
@new_resource.profile(
@new_resource.profile ||
- @new_resource.profile_name
+ @new_resource.profile_name,
)
@new_profile_hash = get_profile_hash(@new_resource.profile)
@@ -141,7 +141,7 @@ class Chef
def get_cache_dir
cache_dir = Chef::FileCache.create_cache_path(
- "profiles/#{@new_resource.cookbook_name}"
+ "profiles/#{@new_resource.cookbook_name}",
)
end
@@ -151,7 +151,7 @@ class Chef
"profiles",
@new_resource.cookbook_name,
::File.dirname(cookbook_file),
- )
+ ),
)
remote_file = Chef::Resource::CookbookFile.new(
::File.join(
diff --git a/lib/chef/provider/package/chocolatey.rb b/lib/chef/provider/package/chocolatey.rb
index e111beb9b5..ad4db0c4e6 100644
--- a/lib/chef/provider/package/chocolatey.rb
+++ b/lib/chef/provider/package/chocolatey.rb
@@ -162,7 +162,7 @@ EOS
# lets us mock out an incorrect value for testing.
def choco_install_path
@choco_install_path ||= powershell_out!(
- PATHFINDING_POWERSHELL_COMMAND
+ PATHFINDING_POWERSHELL_COMMAND,
).stdout.chomp
end
diff --git a/lib/chef/provider/package/pacman.rb b/lib/chef/provider/package/pacman.rb
index fe321037bd..bd8028d881 100644
--- a/lib/chef/provider/package/pacman.rb
+++ b/lib/chef/provider/package/pacman.rb
@@ -54,7 +54,7 @@ class Chef
repos = %w{extra core community}
- if(::File.exists?("/etc/pacman.conf"))
+ if ::File.exists?("/etc/pacman.conf")
pacman = ::File.read("/etc/pacman.conf")
repos = pacman.scan(/\[(.+)\]/).flatten
end
diff --git a/lib/chef/provider/package/paludis.rb b/lib/chef/provider/package/paludis.rb
index e1b2ea1cf4..557e7ebc22 100644
--- a/lib/chef/provider/package/paludis.rb
+++ b/lib/chef/provider/package/paludis.rb
@@ -54,7 +54,7 @@ class Chef
end
def install_package(name, version)
- if(version)
+ if version
pkg = "=#{name}-#{version}"
else
pkg = "#{@new_resource.package_name}"
@@ -67,7 +67,7 @@ class Chef
end
def remove_package(name, version)
- if(version)
+ if version
pkg = "=#{@new_resource.package_name}-#{version}"
else
pkg = "#{@new_resource.package_name}"
diff --git a/lib/chef/provider/package/portage.rb b/lib/chef/provider/package/portage.rb
index 688509889c..a514dcc66c 100644
--- a/lib/chef/provider/package/portage.rb
+++ b/lib/chef/provider/package/portage.rb
@@ -41,7 +41,7 @@ class Chef
globsafe_pkg = Chef::Util::PathHelper.escape_glob(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+)?)})
+ if entry =~ %r{[^/]+/#{Regexp.escape(pkg)}\-(\d[\.\d]*((_(alpha|beta|pre|rc|p)\d*)*)?(-r\d+)?)}
[$&, $1]
end
end.compact
@@ -108,7 +108,7 @@ class Chef
def install_package(name, version)
pkg = "=#{name}-#{version}"
- if(version =~ /^\~(.+)/)
+ if version =~ /^\~(.+)/
# If we start with a tilde
pkg = "~#{name}-#{$1}"
end
@@ -121,7 +121,7 @@ class Chef
end
def remove_package(name, version)
- if(version)
+ if version
pkg = "=#{@new_resource.package_name}-#{version}"
else
pkg = "#{@new_resource.package_name}"
diff --git a/lib/chef/provider/service/gentoo.rb b/lib/chef/provider/service/gentoo.rb
index 66f2f10f23..1bfd46ef14 100644
--- a/lib/chef/provider/service/gentoo.rb
+++ b/lib/chef/provider/service/gentoo.rb
@@ -39,7 +39,7 @@ class Chef::Provider::Service::Gentoo < Chef::Provider::Service::Init
readable = ::File.readable? file
Chef::Log.debug "#{@new_resource} exists: #{exists}, readable: #{readable}"
exists and readable
- end
+ end,
)
Chef::Log.debug "#{@new_resource} enabled: #{@current_resource.enabled}"
diff --git a/lib/chef/provider/service/macosx.rb b/lib/chef/provider/service/macosx.rb
index 63485903c3..cdd5d934ff 100644
--- a/lib/chef/provider/service/macosx.rb
+++ b/lib/chef/provider/service/macosx.rb
@@ -224,7 +224,7 @@ class Chef
# plist files can come in XML or Binary formats. this command
# will make sure we get XML every time.
plist_xml = shell_out_with_systems_locale!(
- "plutil -convert xml1 -o - #{@plist}"
+ "plutil -convert xml1 -o - #{@plist}",
).stdout
plist_doc = REXML::Document.new(plist_xml)
@@ -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(@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 8c282b0d7e..1659e324c0 100644
--- a/lib/chef/provider/user/dscl.rb
+++ b/lib/chef/provider/user/dscl.rb
@@ -230,7 +230,7 @@ user password using shadow hash.")
base_uid = new_resource.system ? 200 : 500
next_uid_guess = base_uid
users_uids = run_dscl("list /Users uid")
- while(next_uid_guess < search_limit + base_uid)
+ while next_uid_guess < search_limit + base_uid
if users_uids =~ Regexp.new("#{Regexp.escape(next_uid_guess.to_s)}\n")
next_uid_guess += 1
else