summaryrefslogtreecommitdiff
path: root/lib/chef/resource
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2018-07-02 10:25:16 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2018-07-02 10:25:16 -0700
commit35603c7ce1bd3ccf35334ed65152140f0ecaf080 (patch)
tree452c84ce196ce00d672c71a8fa65f86c5a074fac /lib/chef/resource
parenteda2808dce8146bfdb308dd658b1dd565df3562b (diff)
downloadchef-35603c7ce1bd3ccf35334ed65152140f0ecaf080.tar.gz
fix Style/HashSyntax
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/chef/resource')
-rw-r--r--lib/chef/resource/cron.rb10
-rw-r--r--lib/chef/resource/dsc_script.rb10
-rw-r--r--lib/chef/resource/execute.rb2
-rw-r--r--lib/chef/resource/file/verification.rb2
-rw-r--r--lib/chef/resource/freebsd_package.rb2
-rw-r--r--lib/chef/resource/group.rb4
-rw-r--r--lib/chef/resource/hostname.rb2
-rw-r--r--lib/chef/resource/http_request.rb2
-rw-r--r--lib/chef/resource/powershell_script.rb4
-rw-r--r--lib/chef/resource/remote_directory.rb6
-rw-r--r--lib/chef/resource/remote_file.rb4
-rw-r--r--lib/chef/resource/service.rb34
-rw-r--r--lib/chef/resource/template.rb2
-rw-r--r--lib/chef/resource/user.rb30
-rw-r--r--lib/chef/resource/windows_script.rb2
15 files changed, 58 insertions, 58 deletions
diff --git a/lib/chef/resource/cron.rb b/lib/chef/resource/cron.rb
index ea6d692709..57cc483c8a 100644
--- a/lib/chef/resource/cron.rb
+++ b/lib/chef/resource/cron.rb
@@ -55,7 +55,7 @@ class Chef
set_or_return(
:minute,
converted_arg,
- :kind_of => String
+ kind_of: String
)
end
@@ -72,7 +72,7 @@ class Chef
set_or_return(
:hour,
converted_arg,
- :kind_of => String
+ kind_of: String
)
end
@@ -89,7 +89,7 @@ class Chef
set_or_return(
:day,
converted_arg,
- :kind_of => String
+ kind_of: String
)
end
@@ -106,7 +106,7 @@ class Chef
set_or_return(
:month,
converted_arg,
- :kind_of => String
+ kind_of: String
)
end
@@ -130,7 +130,7 @@ class Chef
set_or_return(
:weekday,
converted_arg,
- :kind_of => [String, Symbol]
+ kind_of: [String, Symbol]
)
end
diff --git a/lib/chef/resource/dsc_script.rb b/lib/chef/resource/dsc_script.rb
index f3fa5d0314..7d1e11b659 100644
--- a/lib/chef/resource/dsc_script.rb
+++ b/lib/chef/resource/dsc_script.rb
@@ -54,7 +54,7 @@ class Chef
set_or_return(
:code,
arg,
- :kind_of => [ String ]
+ kind_of: [ String ]
)
end
@@ -65,7 +65,7 @@ class Chef
set_or_return(
:configuration_name,
arg,
- :kind_of => [ String ]
+ kind_of: [ String ]
)
end
@@ -76,7 +76,7 @@ class Chef
set_or_return(
:command,
arg,
- :kind_of => [ String ]
+ kind_of: [ String ]
)
end
@@ -87,7 +87,7 @@ class Chef
set_or_return(
:configuration_data,
arg,
- :kind_of => [ String ]
+ kind_of: [ String ]
)
end
@@ -98,7 +98,7 @@ class Chef
set_or_return(
:configuration_data_script,
arg,
- :kind_of => [ String ]
+ kind_of: [ String ]
)
end
diff --git a/lib/chef/resource/execute.rb b/lib/chef/resource/execute.rb
index 7003b546fe..dfccfeb138 100644
--- a/lib/chef/resource/execute.rb
+++ b/lib/chef/resource/execute.rb
@@ -52,7 +52,7 @@ class Chef
set_or_return(
:command,
arg,
- :kind_of => [ String, Array ]
+ kind_of: [ String, Array ]
)
end
property :umask, [ String, Integer ]
diff --git a/lib/chef/resource/file/verification.rb b/lib/chef/resource/file/verification.rb
index 578e6066a2..ae4f9043b2 100644
--- a/lib/chef/resource/file/verification.rb
+++ b/lib/chef/resource/file/verification.rb
@@ -113,7 +113,7 @@ class Chef
if @command.include?("%{file}")
raise ArgumentError, "The %{file} expansion for verify commands has been removed. Please use %{path} instead."
end
- command = @command % { :path => path }
+ command = @command % { path: path }
interpreter = Chef::GuardInterpreter.for_resource(@parent_resource, command, @command_opts)
interpreter.evaluate
end
diff --git a/lib/chef/resource/freebsd_package.rb b/lib/chef/resource/freebsd_package.rb
index e85a75e906..f5e4010ee7 100644
--- a/lib/chef/resource/freebsd_package.rb
+++ b/lib/chef/resource/freebsd_package.rb
@@ -46,7 +46,7 @@ class Chef
#
# @return [Boolean] do we support pkgng
def supports_pkgng?
- ships_with_pkgng? || !!shell_out!("make", "-V", "WITH_PKGNG", :env => nil).stdout.match(/yes/i)
+ ships_with_pkgng? || !!shell_out!("make", "-V", "WITH_PKGNG", env: nil).stdout.match(/yes/i)
end
private
diff --git a/lib/chef/resource/group.rb b/lib/chef/resource/group.rb
index 9298fbc150..b67bfe188e 100644
--- a/lib/chef/resource/group.rb
+++ b/lib/chef/resource/group.rb
@@ -41,7 +41,7 @@ class Chef
set_or_return(
:members,
converted_members,
- :kind_of => [ Array ]
+ kind_of: [ Array ]
)
end
@@ -52,7 +52,7 @@ class Chef
set_or_return(
:excluded_members,
converted_members,
- :kind_of => [ Array ]
+ kind_of: [ Array ]
)
end
diff --git a/lib/chef/resource/hostname.rb b/lib/chef/resource/hostname.rb
index 02996f4464..f213ae47ad 100644
--- a/lib/chef/resource/hostname.rb
+++ b/lib/chef/resource/hostname.rb
@@ -132,7 +132,7 @@ class Chef
# this must come before other methods like /etc/hostname and /etc/sysconfig/network
declare_resource(:execute, "hostnamectl set-hostname #{new_resource.hostname}") do
notifies :reload, "ohai[reload hostname]"
- not_if { shell_out!("hostnamectl status", { :returns => [0, 1] }).stdout =~ /Static hostname:\s*#{new_resource.hostname}\s*$/ }
+ not_if { shell_out!("hostnamectl status", { returns: [0, 1] }).stdout =~ /Static hostname:\s*#{new_resource.hostname}\s*$/ }
end
when ::File.exist?("/etc/hostname")
# debian family uses /etc/hostname
diff --git a/lib/chef/resource/http_request.rb b/lib/chef/resource/http_request.rb
index 3493cec9db..6e92fb821c 100644
--- a/lib/chef/resource/http_request.rb
+++ b/lib/chef/resource/http_request.rb
@@ -48,7 +48,7 @@ class Chef
set_or_return(
:message,
args,
- :kind_of => Object
+ kind_of: Object
)
end
diff --git a/lib/chef/resource/powershell_script.rb b/lib/chef/resource/powershell_script.rb
index 99821bcefd..95efadd4e6 100644
--- a/lib/chef/resource/powershell_script.rb
+++ b/lib/chef/resource/powershell_script.rb
@@ -40,7 +40,7 @@ class Chef
set_or_return(
:convert_boolean_return,
arg,
- :kind_of => [ FalseClass, TrueClass ]
+ kind_of: [ FalseClass, TrueClass ]
)
end
@@ -52,7 +52,7 @@ class Chef
# guard context and recipe resource context will have the
# same behavior.
def self.get_default_attributes(opts)
- { :convert_boolean_return => true }
+ { convert_boolean_return: true }
end
end
end
diff --git a/lib/chef/resource/remote_directory.rb b/lib/chef/resource/remote_directory.rb
index daeb7b35bb..f03b13ef02 100644
--- a/lib/chef/resource/remote_directory.rb
+++ b/lib/chef/resource/remote_directory.rb
@@ -63,7 +63,7 @@ class Chef
set_or_return(
:files_group,
arg,
- :regex => Chef::Config[:group_valid_regex]
+ regex: Chef::Config[:group_valid_regex]
)
end
@@ -71,7 +71,7 @@ class Chef
set_or_return(
:files_mode,
arg,
- :regex => /^\d{3,4}$/
+ regex: /^\d{3,4}$/
)
end
@@ -79,7 +79,7 @@ class Chef
set_or_return(
:files_owner,
arg,
- :regex => Chef::Config[:user_valid_regex]
+ regex: Chef::Config[:user_valid_regex]
)
end
end
diff --git a/lib/chef/resource/remote_file.rb b/lib/chef/resource/remote_file.rb
index 832fd3568e..3607a3cbc5 100644
--- a/lib/chef/resource/remote_file.rb
+++ b/lib/chef/resource/remote_file.rb
@@ -48,8 +48,8 @@ class Chef
arg = parse_source_args(args)
ret = set_or_return(:source,
arg,
- { :callbacks => {
- :validate_source => method(:validate_source),
+ { callbacks: {
+ validate_source: method(:validate_source),
} })
if ret.is_a? String
Array(ret)
diff --git a/lib/chef/resource/service.rb b/lib/chef/resource/service.rb
index 07473c9709..fe13c433cb 100644
--- a/lib/chef/resource/service.rb
+++ b/lib/chef/resource/service.rb
@@ -62,7 +62,7 @@ class Chef
set_or_return(
:service_name,
arg,
- :kind_of => [ String ]
+ kind_of: [ String ]
)
end
@@ -71,7 +71,7 @@ class Chef
set_or_return(
:pattern,
arg,
- :kind_of => [ String ]
+ kind_of: [ String ]
)
end
@@ -80,7 +80,7 @@ class Chef
set_or_return(
:start_command,
arg,
- :kind_of => [ String, NilClass, FalseClass ]
+ kind_of: [ String, NilClass, FalseClass ]
)
end
@@ -89,7 +89,7 @@ class Chef
set_or_return(
:stop_command,
arg,
- :kind_of => [ String, NilClass, FalseClass ]
+ kind_of: [ String, NilClass, FalseClass ]
)
end
@@ -98,7 +98,7 @@ class Chef
set_or_return(
:status_command,
arg,
- :kind_of => [ String, NilClass, FalseClass ]
+ kind_of: [ String, NilClass, FalseClass ]
)
end
@@ -107,7 +107,7 @@ class Chef
set_or_return(
:restart_command,
arg,
- :kind_of => [ String, NilClass, FalseClass ]
+ kind_of: [ String, NilClass, FalseClass ]
)
end
@@ -115,7 +115,7 @@ class Chef
set_or_return(
:reload_command,
arg,
- :kind_of => [ String, NilClass, FalseClass ]
+ kind_of: [ String, NilClass, FalseClass ]
)
end
@@ -128,7 +128,7 @@ class Chef
set_or_return(
:init_command,
arg,
- :kind_of => [ String ]
+ kind_of: [ String ]
)
end
@@ -137,7 +137,7 @@ class Chef
set_or_return(
:enabled,
arg,
- :kind_of => [ TrueClass, FalseClass ]
+ kind_of: [ TrueClass, FalseClass ]
)
end
@@ -146,7 +146,7 @@ class Chef
set_or_return(
:running,
arg,
- :kind_of => [ TrueClass, FalseClass ]
+ kind_of: [ TrueClass, FalseClass ]
)
end
@@ -155,7 +155,7 @@ class Chef
set_or_return(
:masked,
arg,
- :kind_of => [ TrueClass, FalseClass ]
+ kind_of: [ TrueClass, FalseClass ]
)
end
@@ -163,7 +163,7 @@ class Chef
set_or_return(
:options,
arg.respond_to?(:split) ? arg.shellsplit : arg,
- :kind_of => [ Array, String ]
+ kind_of: [ Array, String ]
)
end
@@ -181,7 +181,7 @@ class Chef
set_or_return(
:priority,
arg,
- :kind_of => [ Integer, String, Hash ]
+ kind_of: [ Integer, String, Hash ]
)
end
@@ -190,7 +190,7 @@ class Chef
set_or_return(
:timeout,
arg,
- :kind_of => Integer
+ kind_of: Integer
)
end
@@ -198,7 +198,7 @@ class Chef
set_or_return(
:parameters,
arg,
- :kind_of => [ Hash ]
+ kind_of: [ Hash ]
)
end
@@ -206,14 +206,14 @@ class Chef
set_or_return(
:run_levels,
arg,
- :kind_of => [ Array ] )
+ kind_of: [ Array ] )
end
def user(arg = nil)
set_or_return(
:user,
arg,
- :kind_of => [ String ]
+ kind_of: [ String ]
)
end
end
diff --git a/lib/chef/resource/template.rb b/lib/chef/resource/template.rb
index 5fc29ec1c6..45879db8e6 100644
--- a/lib/chef/resource/template.rb
+++ b/lib/chef/resource/template.rb
@@ -53,7 +53,7 @@ class Chef
set_or_return(
:source,
file,
- :kind_of => [ String, Array ]
+ kind_of: [ String, Array ]
)
end
diff --git a/lib/chef/resource/user.rb b/lib/chef/resource/user.rb
index 39d8159d4f..df52ebb083 100644
--- a/lib/chef/resource/user.rb
+++ b/lib/chef/resource/user.rb
@@ -51,7 +51,7 @@ class Chef
set_or_return(
:username,
arg,
- :kind_of => [ String ]
+ kind_of: [ String ]
)
end
@@ -59,7 +59,7 @@ class Chef
set_or_return(
:comment,
arg,
- :kind_of => [ String ]
+ kind_of: [ String ]
)
end
@@ -67,8 +67,8 @@ class Chef
set_or_return(
:uid,
arg,
- :kind_of => [ String, Integer, NilClass ],
- :coerce => proc { |x| x || nil }
+ kind_of: [ String, Integer, NilClass ],
+ coerce: proc { |x| x || nil }
)
end
@@ -76,8 +76,8 @@ class Chef
set_or_return(
:gid,
arg,
- :kind_of => [ String, Integer, NilClass ],
- :coerce => proc { |x| x || nil }
+ kind_of: [ String, Integer, NilClass ],
+ coerce: proc { |x| x || nil }
)
end
@@ -87,7 +87,7 @@ class Chef
set_or_return(
:home,
arg,
- :kind_of => [ String ]
+ kind_of: [ String ]
)
end
@@ -95,7 +95,7 @@ class Chef
set_or_return(
:shell,
arg,
- :kind_of => [ String ]
+ kind_of: [ String ]
)
end
@@ -103,7 +103,7 @@ class Chef
set_or_return(
:password,
arg,
- :kind_of => [ String ]
+ kind_of: [ String ]
)
end
@@ -111,7 +111,7 @@ class Chef
set_or_return(
:salt,
arg,
- :kind_of => [ String ]
+ kind_of: [ String ]
)
end
@@ -119,7 +119,7 @@ class Chef
set_or_return(
:iterations,
arg,
- :kind_of => [ Integer ]
+ kind_of: [ Integer ]
)
end
@@ -127,7 +127,7 @@ class Chef
set_or_return(
:system,
arg,
- :kind_of => [ TrueClass, FalseClass ]
+ kind_of: [ TrueClass, FalseClass ]
)
end
@@ -135,7 +135,7 @@ class Chef
set_or_return(
:manage_home,
arg,
- :kind_of => [ TrueClass, FalseClass ]
+ kind_of: [ TrueClass, FalseClass ]
)
end
@@ -143,7 +143,7 @@ class Chef
set_or_return(
:force,
arg,
- :kind_of => [ TrueClass, FalseClass ]
+ kind_of: [ TrueClass, FalseClass ]
)
end
@@ -151,7 +151,7 @@ class Chef
set_or_return(
:non_unique,
arg,
- :kind_of => [ TrueClass, FalseClass ]
+ kind_of: [ TrueClass, FalseClass ]
)
end
end
diff --git a/lib/chef/resource/windows_script.rb b/lib/chef/resource/windows_script.rb
index 7c39d9fba0..fe3e37989d 100644
--- a/lib/chef/resource/windows_script.rb
+++ b/lib/chef/resource/windows_script.rb
@@ -45,7 +45,7 @@ class Chef
result = set_or_return(
:architecture,
arg,
- :kind_of => Symbol
+ kind_of: Symbol
)
end