summaryrefslogtreecommitdiff
path: root/lib/chef/provider
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2016-01-18 09:12:29 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2016-01-18 09:12:29 -0800
commit86643d99789002eca3f064f3450fe48dcd316753 (patch)
tree525ffeff996a1333a498d33821fe7257281a8337 /lib/chef/provider
parentca084429991a141127c80e9d2a08cb1bb68585c4 (diff)
downloadchef-86643d99789002eca3f064f3450fe48dcd316753.tar.gz
Autofixing Style/PercentLiteralDelimeterslcg/percentliteraldelimeters
See chef/chefstyle#11 for analysis and discussion. We select '{}' since audit of our source code shows that is the most common, and that used to be the dominant learning paradigm (e.g. in ruby 1.9 pickaxe book.
Diffstat (limited to 'lib/chef/provider')
-rw-r--r--lib/chef/provider/cron.rb2
-rw-r--r--lib/chef/provider/git.rb2
-rw-r--r--lib/chef/provider/group/usermod.rb2
-rw-r--r--lib/chef/provider/ifconfig/aix.rb2
-rw-r--r--lib/chef/provider/ifconfig/debian.rb4
-rw-r--r--lib/chef/provider/ifconfig/redhat.rb2
-rw-r--r--lib/chef/provider/mount/aix.rb2
-rw-r--r--lib/chef/provider/mount/mount.rb2
-rw-r--r--lib/chef/provider/mount/solaris.rb4
-rw-r--r--lib/chef/provider/package/ips.rb2
-rw-r--r--lib/chef/provider/package/rpm.rb2
-rw-r--r--lib/chef/provider/package/rubygems.rb2
-rw-r--r--lib/chef/provider/package/yum.rb2
-rw-r--r--lib/chef/provider/service.rb2
-rw-r--r--lib/chef/provider/service/debian.rb2
-rw-r--r--lib/chef/provider/service/insserv.rb2
-rw-r--r--lib/chef/provider/service/redhat.rb2
-rw-r--r--lib/chef/provider/user/aix.rb2
-rw-r--r--lib/chef/provider/user/pw.rb2
-rw-r--r--lib/chef/provider/user/solaris.rb2
20 files changed, 22 insertions, 22 deletions
diff --git a/lib/chef/provider/cron.rb b/lib/chef/provider/cron.rb
index fbd6510121..361691aa0a 100644
--- a/lib/chef/provider/cron.rb
+++ b/lib/chef/provider/cron.rb
@@ -199,7 +199,7 @@ class Chef
private
def set_environment_var(attr_name, attr_value)
- if %w(MAILTO PATH SHELL HOME).include?(attr_name)
+ if %w{MAILTO PATH SHELL HOME}.include?(attr_name)
@current_resource.send(attr_name.downcase.to_sym, attr_value)
else
@current_resource.environment(@current_resource.environment.merge(attr_name => attr_value))
diff --git a/lib/chef/provider/git.rb b/lib/chef/provider/git.rb
index 07008b98f6..a0f6d076df 100644
--- a/lib/chef/provider/git.rb
+++ b/lib/chef/provider/git.rb
@@ -283,7 +283,7 @@ class Chef
end
def git_ls_remote(rev_pattern)
- command = git(%Q(ls-remote "#{@new_resource.repository}" "#{rev_pattern}"))
+ command = git(%Q{ls-remote "#{@new_resource.repository}" "#{rev_pattern}"})
shell_out!(command, run_options).stdout
end
diff --git a/lib/chef/provider/group/usermod.rb b/lib/chef/provider/group/usermod.rb
index 51b14234ba..f4f3ac55ae 100644
--- a/lib/chef/provider/group/usermod.rb
+++ b/lib/chef/provider/group/usermod.rb
@@ -23,7 +23,7 @@ class Chef
class Group
class Usermod < Chef::Provider::Group::Groupadd
- provides :group, os: %w(openbsd solaris2 hpux)
+ provides :group, os: %w{openbsd solaris2 hpux}
provides :group, platform: "opensuse"
def load_current_resource
diff --git a/lib/chef/provider/ifconfig/aix.rb b/lib/chef/provider/ifconfig/aix.rb
index 4ceb7866db..30e702fe10 100644
--- a/lib/chef/provider/ifconfig/aix.rb
+++ b/lib/chef/provider/ifconfig/aix.rb
@@ -22,7 +22,7 @@ class Chef
class Provider
class Ifconfig
class Aix < Chef::Provider::Ifconfig
- provides :ifconfig, platform: %w(aix)
+ provides :ifconfig, platform: %w{aix}
def load_current_resource
@current_resource = Chef::Resource::Ifconfig.new(@new_resource.name)
diff --git a/lib/chef/provider/ifconfig/debian.rb b/lib/chef/provider/ifconfig/debian.rb
index b7e4adc0a3..3885e55998 100644
--- a/lib/chef/provider/ifconfig/debian.rb
+++ b/lib/chef/provider/ifconfig/debian.rb
@@ -23,8 +23,8 @@ class Chef
class Provider
class Ifconfig
class Debian < Chef::Provider::Ifconfig
- provides :ifconfig, platform: %w(ubuntu), platform_version: ">= 11.10"
- provides :ifconfig, platform: %w(debian), platform_version: ">= 7.0"
+ provides :ifconfig, platform: %w{ubuntu}, platform_version: ">= 11.10"
+ provides :ifconfig, platform: %w{debian}, platform_version: ">= 7.0"
INTERFACES_FILE = "/etc/network/interfaces"
INTERFACES_DOT_D_DIR = "/etc/network/interfaces.d"
diff --git a/lib/chef/provider/ifconfig/redhat.rb b/lib/chef/provider/ifconfig/redhat.rb
index b0131f8f5a..8c02c1be07 100644
--- a/lib/chef/provider/ifconfig/redhat.rb
+++ b/lib/chef/provider/ifconfig/redhat.rb
@@ -22,7 +22,7 @@ class Chef
class Provider
class Ifconfig
class Redhat < Chef::Provider::Ifconfig
- provides :ifconfig, platform_family: %w(fedora rhel)
+ provides :ifconfig, platform_family: %w{fedora rhel}
def initialize(new_resource, run_context)
super(new_resource, run_context)
diff --git a/lib/chef/provider/mount/aix.rb b/lib/chef/provider/mount/aix.rb
index 577505ac69..a6fccfadf4 100644
--- a/lib/chef/provider/mount/aix.rb
+++ b/lib/chef/provider/mount/aix.rb
@@ -22,7 +22,7 @@ class Chef
class Provider
class Mount
class Aix < Chef::Provider::Mount::Mount
- provides :mount, platform: %w(aix)
+ provides :mount, platform: %w{aix}
# Override for aix specific handling
def initialize(new_resource, run_context)
diff --git a/lib/chef/provider/mount/mount.rb b/lib/chef/provider/mount/mount.rb
index fe657659ad..e0bddb454a 100644
--- a/lib/chef/provider/mount/mount.rb
+++ b/lib/chef/provider/mount/mount.rb
@@ -193,7 +193,7 @@ class Chef
def device_should_exist?
( @new_resource.device != "none" ) &&
( not network_device? ) &&
- ( not %w[ cgroup tmpfs fuse ].include? @new_resource.fstype )
+ ( not %w{ cgroup tmpfs fuse }.include? @new_resource.fstype )
end
private
diff --git a/lib/chef/provider/mount/solaris.rb b/lib/chef/provider/mount/solaris.rb
index f61b9e673b..76f1ac0137 100644
--- a/lib/chef/provider/mount/solaris.rb
+++ b/lib/chef/provider/mount/solaris.rb
@@ -27,7 +27,7 @@ class Chef
class Mount
# Mount Solaris File systems
class Solaris < Chef::Provider::Mount
- provides :mount, platform: %w(openindiana opensolaris nexentacore omnios solaris2 smartos)
+ provides :mount, platform: %w{openindiana opensolaris nexentacore omnios solaris2 smartos}
extend Forwardable
@@ -202,7 +202,7 @@ class Chef
end
def device_should_exist?
- !%w(tmpfs nfs ctfs proc mntfs objfs sharefs fd smbfs vxfs).include?(fstype)
+ !%w{tmpfs nfs ctfs proc mntfs objfs sharefs fd smbfs vxfs}.include?(fstype)
end
def mount_at_boot?
diff --git a/lib/chef/provider/package/ips.rb b/lib/chef/provider/package/ips.rb
index 84cb19486f..a69a2e24e0 100644
--- a/lib/chef/provider/package/ips.rb
+++ b/lib/chef/provider/package/ips.rb
@@ -27,7 +27,7 @@ class Chef
class Package
class Ips < Chef::Provider::Package
- provides :package, platform: %w(openindiana opensolaris omnios solaris2)
+ provides :package, platform: %w{openindiana opensolaris omnios solaris2}
provides :ips_package, os: "solaris2"
attr_accessor :virtual
diff --git a/lib/chef/provider/package/rpm.rb b/lib/chef/provider/package/rpm.rb
index 019d26d92e..9ab10b062d 100644
--- a/lib/chef/provider/package/rpm.rb
+++ b/lib/chef/provider/package/rpm.rb
@@ -113,7 +113,7 @@ class Chef
def uri_scheme?(str)
scheme = URI.split(str).first
return false unless scheme
- %w(http https ftp file).include?(scheme.downcase)
+ %w{http https ftp file}.include?(scheme.downcase)
rescue URI::InvalidURIError
return false
end
diff --git a/lib/chef/provider/package/rubygems.rb b/lib/chef/provider/package/rubygems.rb
index 034f526060..85796e8b9a 100644
--- a/lib/chef/provider/package/rubygems.rb
+++ b/lib/chef/provider/package/rubygems.rb
@@ -394,7 +394,7 @@ class Chef
end
def is_omnibus?
- if RbConfig::CONFIG["bindir"] =~ %r!/(opscode|chef|chefdk)/embedded/bin!
+ if RbConfig::CONFIG["bindir"] =~ %r{/(opscode|chef|chefdk)/embedded/bin}
Chef::Log.debug("#{@new_resource} detected omnibus installation in #{RbConfig::CONFIG['bindir']}")
# Omnibus installs to a static path because of linking on unix, find it.
true
diff --git a/lib/chef/provider/package/yum.rb b/lib/chef/provider/package/yum.rb
index 7b291d5f00..c3fd3f69ec 100644
--- a/lib/chef/provider/package/yum.rb
+++ b/lib/chef/provider/package/yum.rb
@@ -28,7 +28,7 @@ class Chef
class Package
class Yum < Chef::Provider::Package
- provides :package, platform_family: %w(rhel fedora)
+ provides :package, platform_family: %w{rhel fedora}
provides :yum_package, os: "linux"
class RPMUtils
diff --git a/lib/chef/provider/service.rb b/lib/chef/provider/service.rb
index 1c0738112a..6e1d0b4064 100644
--- a/lib/chef/provider/service.rb
+++ b/lib/chef/provider/service.rb
@@ -205,7 +205,7 @@ class Chef
Chef.set_provider_priority_array :service, [ Systemd, Arch ], platform_family: "arch"
Chef.set_provider_priority_array :service, [ Systemd, Gentoo ], platform_family: "gentoo"
Chef.set_provider_priority_array :service, [ Systemd, Upstart, Insserv, Debian, Invokercd ], platform_family: "debian"
- Chef.set_provider_priority_array :service, [ Systemd, Insserv, Redhat ], platform_family: %w(rhel fedora suse)
+ Chef.set_provider_priority_array :service, [ Systemd, Insserv, Redhat ], platform_family: %w{rhel fedora suse}
end
end
end
diff --git a/lib/chef/provider/service/debian.rb b/lib/chef/provider/service/debian.rb
index 9d80f5f924..559ad48418 100644
--- a/lib/chef/provider/service/debian.rb
+++ b/lib/chef/provider/service/debian.rb
@@ -109,7 +109,7 @@ class Chef
priority.each { |runlevel, arguments|
Chef::Log.debug("#{new_resource} runlevel #{runlevel}, action #{arguments[0]}, priority #{arguments[1]}")
# if we are in a update-rc.d default startup runlevel && we start in this runlevel
- if %w[ 1 2 3 4 5 S ].include?(runlevel) && arguments[0] == :start
+ if %w{ 1 2 3 4 5 S }.include?(runlevel) && arguments[0] == :start
enabled = true
end
}
diff --git a/lib/chef/provider/service/insserv.rb b/lib/chef/provider/service/insserv.rb
index 87527599b0..1c4d294053 100644
--- a/lib/chef/provider/service/insserv.rb
+++ b/lib/chef/provider/service/insserv.rb
@@ -24,7 +24,7 @@ class Chef
class Service
class Insserv < Chef::Provider::Service::Init
- provides :service, platform_family: %w(debian rhel fedora suse) do |node|
+ provides :service, platform_family: %w{debian rhel fedora suse} do |node|
Chef::Platform::ServiceHelpers.service_resource_providers.include?(:insserv)
end
diff --git a/lib/chef/provider/service/redhat.rb b/lib/chef/provider/service/redhat.rb
index f93cd36348..9cc4258b70 100644
--- a/lib/chef/provider/service/redhat.rb
+++ b/lib/chef/provider/service/redhat.rb
@@ -28,7 +28,7 @@ class Chef
# @api private
attr_accessor :current_run_levels
- provides :service, platform_family: %w(rhel fedora suse) do |node|
+ provides :service, platform_family: %w{rhel fedora suse} do |node|
Chef::Platform::ServiceHelpers.service_resource_providers.include?(:redhat)
end
diff --git a/lib/chef/provider/user/aix.rb b/lib/chef/provider/user/aix.rb
index a575a41e54..83bd900f79 100644
--- a/lib/chef/provider/user/aix.rb
+++ b/lib/chef/provider/user/aix.rb
@@ -18,7 +18,7 @@ class Chef
class Provider
class User
class Aix < Chef::Provider::User::Useradd
- provides :user, platform: %w(aix)
+ provides :user, platform: %w{aix}
UNIVERSAL_OPTIONS = [[:comment, "-c"], [:gid, "-g"], [:shell, "-s"], [:uid, "-u"]]
diff --git a/lib/chef/provider/user/pw.rb b/lib/chef/provider/user/pw.rb
index 37890bdc1e..60df7d55f8 100644
--- a/lib/chef/provider/user/pw.rb
+++ b/lib/chef/provider/user/pw.rb
@@ -22,7 +22,7 @@ class Chef
class Provider
class User
class Pw < Chef::Provider::User
- provides :user, platform: %w(freebsd)
+ provides :user, platform: %w{freebsd}
def load_current_resource
super
diff --git a/lib/chef/provider/user/solaris.rb b/lib/chef/provider/user/solaris.rb
index d9108d4ca4..18f44523ff 100644
--- a/lib/chef/provider/user/solaris.rb
+++ b/lib/chef/provider/user/solaris.rb
@@ -24,7 +24,7 @@ class Chef
class Provider
class User
class Solaris < Chef::Provider::User::Useradd
- provides :user, platform: %w(omnios solaris2)
+ provides :user, platform: %w{omnios solaris2}
UNIVERSAL_OPTIONS = [[:comment, "-c"], [:gid, "-g"], [:shell, "-s"], [:uid, "-u"]]
attr_writer :password_file