summaryrefslogtreecommitdiff
path: root/lib/chef/util
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/util
parenteda2808dce8146bfdb308dd658b1dd565df3562b (diff)
downloadchef-35603c7ce1bd3ccf35334ed65152140f0ecaf080.tar.gz
fix Style/HashSyntax
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/chef/util')
-rw-r--r--lib/chef/util/backup.rb2
-rw-r--r--lib/chef/util/diff.rb2
-rw-r--r--lib/chef/util/dsc/configuration_generator.rb2
-rw-r--r--lib/chef/util/dsc/lcm_output_parser.rb2
-rw-r--r--lib/chef/util/file_edit.rb2
-rw-r--r--lib/chef/util/powershell/cmdlet.rb6
-rw-r--r--lib/chef/util/selinux.rb2
7 files changed, 9 insertions, 9 deletions
diff --git a/lib/chef/util/backup.rb b/lib/chef/util/backup.rb
index 8bf2b3f25b..a14f006d59 100644
--- a/lib/chef/util/backup.rb
+++ b/lib/chef/util/backup.rb
@@ -69,7 +69,7 @@ class Chef
def do_backup
FileUtils.mkdir_p(::File.dirname(backup_path)) if Chef::Config[:file_backup_path]
- FileUtils.cp(path, backup_path, :preserve => true)
+ FileUtils.cp(path, backup_path, preserve: true)
Chef::Log.info("#{@new_resource} backed up to #{backup_path}")
end
diff --git a/lib/chef/util/diff.rb b/lib/chef/util/diff.rb
index b5c85df56d..decff35d85 100644
--- a/lib/chef/util/diff.rb
+++ b/lib/chef/util/diff.rb
@@ -176,7 +176,7 @@ class Chef
end
def encode_diff_for_json(diff_str)
- diff_str.encode!("UTF-8", :invalid => :replace, :undef => :replace, :replace => "?")
+ diff_str.encode!("UTF-8", invalid: :replace, undef: :replace, replace: "?")
end
end
diff --git a/lib/chef/util/dsc/configuration_generator.rb b/lib/chef/util/dsc/configuration_generator.rb
index 3e9475bac2..78092b3c0d 100644
--- a/lib/chef/util/dsc/configuration_generator.rb
+++ b/lib/chef/util/dsc/configuration_generator.rb
@@ -68,7 +68,7 @@ class Chef::Util::DSC
end
def get_merged_configuration_flags!(configuration_flags, configuration_name)
- merged_configuration_flags = { :outputpath => configuration_document_directory(configuration_name) }
+ merged_configuration_flags = { outputpath: configuration_document_directory(configuration_name) }
if configuration_flags
configuration_flags.map do |switch, value|
if merged_configuration_flags.key?(switch.to_s.downcase.to_sym)
diff --git a/lib/chef/util/dsc/lcm_output_parser.rb b/lib/chef/util/dsc/lcm_output_parser.rb
index 658d5c7d8f..b164db6b19 100644
--- a/lib/chef/util/dsc/lcm_output_parser.rb
+++ b/lib/chef/util/dsc/lcm_output_parser.rb
@@ -128,7 +128,7 @@ class Chef
if current_resource[:name]
resources.push(current_resource)
end
- current_resource = { :name => info }
+ current_resource = { name: info }
else
Chef::Log.trace("Ignoring op_action #{op_action}: Read line #{line}")
end
diff --git a/lib/chef/util/file_edit.rb b/lib/chef/util/file_edit.rb
index 5aa33fd169..74e2ca6a5f 100644
--- a/lib/chef/util/file_edit.rb
+++ b/lib/chef/util/file_edit.rb
@@ -84,7 +84,7 @@ class Chef
def write_file
if @changes
backup_pathname = original_pathname + ".old"
- FileUtils.cp(original_pathname, backup_pathname, :preserve => true)
+ FileUtils.cp(original_pathname, backup_pathname, preserve: true)
File.open(original_pathname, "w") do |newfile|
editor.lines.each do |line|
newfile.puts(line)
diff --git a/lib/chef/util/powershell/cmdlet.rb b/lib/chef/util/powershell/cmdlet.rb
index e300266b1e..edd3e92da1 100644
--- a/lib/chef/util/powershell/cmdlet.rb
+++ b/lib/chef/util/powershell/cmdlet.rb
@@ -48,8 +48,8 @@ class Chef
attr_reader :output_format
def run(switches = {}, execution_options = {}, *arguments)
- streams = { :json => CmdletStream.new("json"),
- :verbose => CmdletStream.new("verbose"),
+ streams = { json: CmdletStream.new("json"),
+ verbose: CmdletStream.new("verbose"),
}
arguments_string = arguments.join(" ")
@@ -74,7 +74,7 @@ class Chef
"#{arguments_string} #{redirections}"\
"#{json_command}\";if ( ! $? ) { exit 1 }"
- augmented_options = { :returns => [0], :live_stream => false }.merge(execution_options)
+ augmented_options = { returns: [0], live_stream: false }.merge(execution_options)
command = Mixlib::ShellOut.new(command_string, augmented_options)
status = nil
diff --git a/lib/chef/util/selinux.rb b/lib/chef/util/selinux.rb
index fb0c98cff5..a46e486f96 100644
--- a/lib/chef/util/selinux.rb
+++ b/lib/chef/util/selinux.rb
@@ -72,7 +72,7 @@ class Chef
def check_selinux_enabled?
if selinuxenabled_path
- cmd = shell_out!(selinuxenabled_path, :returns => [0, 1])
+ cmd = shell_out!(selinuxenabled_path, returns: [0, 1])
case cmd.exitstatus
when 1
return false