summaryrefslogtreecommitdiff
path: root/lib/chef/provider
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/provider')
-rw-r--r--lib/chef/provider/cron/unix.rb4
-rw-r--r--lib/chef/provider/dsc_resource.rb2
-rw-r--r--lib/chef/provider/dsc_script.rb16
-rw-r--r--lib/chef/provider/execute.rb2
-rw-r--r--lib/chef/provider/mdadm.rb2
-rw-r--r--lib/chef/provider/mount/windows.rb8
-rw-r--r--lib/chef/provider/reboot.rb8
-rw-r--r--lib/chef/provider/remote_file/sftp.rb2
-rw-r--r--lib/chef/provider/service/redhat.rb2
-rw-r--r--lib/chef/provider/service/solaris.rb2
-rw-r--r--lib/chef/provider/service/systemd.rb4
-rw-r--r--lib/chef/provider/service/windows.rb4
-rw-r--r--lib/chef/provider/subversion.rb4
-rw-r--r--lib/chef/provider/systemd_unit.rb4
-rw-r--r--lib/chef/provider/template/content.rb2
15 files changed, 33 insertions, 33 deletions
diff --git a/lib/chef/provider/cron/unix.rb b/lib/chef/provider/cron/unix.rb
index 15195dbb88..4edd5ba206 100644
--- a/lib/chef/provider/cron/unix.rb
+++ b/lib/chef/provider/cron/unix.rb
@@ -33,7 +33,7 @@ class Chef
private
def read_crontab
- crontab = shell_out("/usr/bin/crontab -l", :user => @new_resource.user)
+ crontab = shell_out("/usr/bin/crontab -l", user: @new_resource.user)
status = crontab.status.exitstatus
logger.trace crontab.format_for_exception if status > 0
@@ -53,7 +53,7 @@ class Chef
exit_status = 0
error_message = ""
begin
- crontab_write = shell_out("/usr/bin/crontab #{tempcron.path}", :user => @new_resource.user)
+ crontab_write = shell_out("/usr/bin/crontab #{tempcron.path}", user: @new_resource.user)
stderr = crontab_write.stderr
exit_status = crontab_write.status.exitstatus
# solaris9, 10 on some failures for example invalid 'mins' in crontab fails with exit code of zero :(
diff --git a/lib/chef/provider/dsc_resource.rb b/lib/chef/provider/dsc_resource.rb
index 9c147cb634..3a209a08a1 100644
--- a/lib/chef/provider/dsc_resource.rb
+++ b/lib/chef/provider/dsc_resource.rb
@@ -169,7 +169,7 @@ class Chef
"Invoke-DscResource #{switches}",
output_format
)
- cmdlet.run!({}, { :timeout => new_resource.timeout })
+ cmdlet.run!({}, { timeout: new_resource.timeout })
end
def return_dsc_resource_result(result, property_name)
diff --git a/lib/chef/provider/dsc_script.rb b/lib/chef/provider/dsc_script.rb
index 7a101fa68b..fd20f34786 100644
--- a/lib/chef/provider/dsc_script.rb
+++ b/lib/chef/provider/dsc_script.rb
@@ -32,10 +32,10 @@ class Chef
@dsc_resource = dsc_resource
@resource_converged = false
@operations = {
- :set => Proc.new do |config_manager, document, shellout_flags|
+ set: Proc.new do |config_manager, document, shellout_flags|
config_manager.set_configuration(document, shellout_flags)
end,
- :test => Proc.new do |config_manager, document, shellout_flags|
+ test: Proc.new do |config_manager, document, shellout_flags|
config_manager.test_configuration(document, shellout_flags)
end }
end
@@ -86,9 +86,9 @@ class Chef
config_manager = Chef::Util::DSC::LocalConfigurationManager.new(@run_context.node, config_directory)
shellout_flags = {
- :cwd => @dsc_resource.cwd,
- :environment => @dsc_resource.environment,
- :timeout => @dsc_resource.timeout,
+ cwd: @dsc_resource.cwd,
+ environment: @dsc_resource.environment,
+ timeout: @dsc_resource.timeout,
}
begin
@@ -113,9 +113,9 @@ class Chef
def generate_configuration_document(config_directory, configuration_flags)
shellout_flags = {
- :cwd => @dsc_resource.cwd,
- :environment => @dsc_resource.environment,
- :timeout => @dsc_resource.timeout,
+ cwd: @dsc_resource.cwd,
+ environment: @dsc_resource.environment,
+ timeout: @dsc_resource.timeout,
}
generator = Chef::Util::DSC::ConfigurationGenerator.new(@run_context.node, config_directory)
diff --git a/lib/chef/provider/execute.rb b/lib/chef/provider/execute.rb
index 3d3255260f..1b97dbf464 100644
--- a/lib/chef/provider/execute.rb
+++ b/lib/chef/provider/execute.rb
@@ -102,7 +102,7 @@ class Chef
opts[:log_tag] = new_resource.to_s
if (logger.info? || live_stream?) && !sensitive?
if run_context.events.formatter?
- opts[:live_stream] = Chef::EventDispatch::EventsOutputStream.new(run_context.events, :name => :execute)
+ opts[:live_stream] = Chef::EventDispatch::EventsOutputStream.new(run_context.events, name: :execute)
elsif stream_to_stdout?
opts[:live_stream] = STDOUT
end
diff --git a/lib/chef/provider/mdadm.rb b/lib/chef/provider/mdadm.rb
index c5f15a851a..9b023b1a65 100644
--- a/lib/chef/provider/mdadm.rb
+++ b/lib/chef/provider/mdadm.rb
@@ -31,7 +31,7 @@ class Chef
logger.trace("#{new_resource} checking for software raid device #{current_resource.raid_device}")
device_not_found = 4
- mdadm = shell_out!("mdadm --detail --test #{new_resource.raid_device}", :returns => [0, device_not_found])
+ mdadm = shell_out!("mdadm --detail --test #{new_resource.raid_device}", returns: [0, device_not_found])
exists = (mdadm.status == 0)
current_resource.exists(exists)
end
diff --git a/lib/chef/provider/mount/windows.rb b/lib/chef/provider/mount/windows.rb
index 590b2bfa52..0fb9184783 100644
--- a/lib/chef/provider/mount/windows.rb
+++ b/lib/chef/provider/mount/windows.rb
@@ -61,10 +61,10 @@ class Chef
def mount_fs
unless @current_resource.mounted
- @mount.add(:remote => @new_resource.device,
- :username => @new_resource.username,
- :domainname => @new_resource.domain,
- :password => @new_resource.password)
+ @mount.add(remote: @new_resource.device,
+ username: @new_resource.username,
+ domainname: @new_resource.domain,
+ password: @new_resource.password)
logger.trace("#{@new_resource} is mounted at #{@new_resource.mount_point}")
else
logger.trace("#{@new_resource} is already mounted at #{@new_resource.mount_point}")
diff --git a/lib/chef/provider/reboot.rb b/lib/chef/provider/reboot.rb
index f054af0567..dd07e7448d 100644
--- a/lib/chef/provider/reboot.rb
+++ b/lib/chef/provider/reboot.rb
@@ -45,10 +45,10 @@ class Chef
# @return [void]
def request_reboot
node.run_context.request_reboot(
- :delay_mins => new_resource.delay_mins,
- :reason => new_resource.reason,
- :timestamp => Time.now,
- :requested_by => new_resource.name
+ delay_mins: new_resource.delay_mins,
+ reason: new_resource.reason,
+ timestamp: Time.now,
+ requested_by: new_resource.name
)
end
diff --git a/lib/chef/provider/remote_file/sftp.rb b/lib/chef/provider/remote_file/sftp.rb
index 21c5c4ca04..66540fea8c 100644
--- a/lib/chef/provider/remote_file/sftp.rb
+++ b/lib/chef/provider/remote_file/sftp.rb
@@ -58,7 +58,7 @@ class Chef
def sftp
host = port ? "#{hostname}:#{port}" : hostname
- @sftp ||= Net::SFTP.start(host, user, :password => pass)
+ @sftp ||= Net::SFTP.start(host, user, password: pass)
end
def pass
diff --git a/lib/chef/provider/service/redhat.rb b/lib/chef/provider/service/redhat.rb
index 1da3d7c01a..18ef245083 100644
--- a/lib/chef/provider/service/redhat.rb
+++ b/lib/chef/provider/service/redhat.rb
@@ -81,7 +81,7 @@ class Chef
super
if ::File.exists?("/sbin/chkconfig")
- chkconfig = shell_out!("/sbin/chkconfig --list #{current_resource.service_name}", :returns => [0, 1])
+ chkconfig = shell_out!("/sbin/chkconfig --list #{current_resource.service_name}", returns: [0, 1])
unless run_levels.nil? || run_levels.empty?
all_levels_match = true
chkconfig.stdout.split(/\s+/)[1..-1].each do |level|
diff --git a/lib/chef/provider/service/solaris.rb b/lib/chef/provider/service/solaris.rb
index f2b1ec4262..51105bd06f 100644
--- a/lib/chef/provider/service/solaris.rb
+++ b/lib/chef/provider/service/solaris.rb
@@ -80,7 +80,7 @@ class Chef
end
def service_status
- cmd = shell_out!(@status_command, "-l", @current_resource.service_name, :returns => [0, 1])
+ cmd = shell_out!(@status_command, "-l", @current_resource.service_name, returns: [0, 1])
# Example output
# $ svcs -l rsyslog
# fmri svc:/application/rsyslog:default
diff --git a/lib/chef/provider/service/systemd.rb b/lib/chef/provider/service/systemd.rb
index badd7695a5..6d5bc338c7 100644
--- a/lib/chef/provider/service/systemd.rb
+++ b/lib/chef/provider/service/systemd.rb
@@ -79,10 +79,10 @@ class Chef::Provider::Service::Systemd < Chef::Provider::Service::Simple
if new_resource.user
uid = Etc.getpwnam(new_resource.user).uid
options = {
- :environment => {
+ environment: {
"DBUS_SESSION_BUS_ADDRESS" => "unix:path=/run/user/#{uid}/bus",
},
- :user => new_resource.user,
+ user: new_resource.user,
}
args = "--user"
else
diff --git a/lib/chef/provider/service/windows.rb b/lib/chef/provider/service/windows.rb
index 487940e84e..3e177d744b 100644
--- a/lib/chef/provider/service/windows.rb
+++ b/lib/chef/provider/service/windows.rb
@@ -361,8 +361,8 @@ class Chef::Provider::Service::Windows < Chef::Provider::Service
logger.trace "#{@new_resource.name} setting start_type to #{type}"
Win32::Service.configure(
- :service_name => @new_resource.service_name,
- :start_type => startup_type
+ service_name: @new_resource.service_name,
+ start_type: startup_type
)
@new_resource.updated_by_last_action(true)
end
diff --git a/lib/chef/provider/subversion.rb b/lib/chef/provider/subversion.rb
index abcc260a78..c5c2439d84 100644
--- a/lib/chef/provider/subversion.rb
+++ b/lib/chef/provider/subversion.rb
@@ -126,7 +126,7 @@ class Chef
new_resource.revision
else
command = scm(:info, new_resource.repository, new_resource.svn_info_args, authentication, "-r#{new_resource.revision}")
- svn_info = shell_out!(command, run_options(:cwd => cwd, :returns => [0, 1])).stdout
+ svn_info = shell_out!(command, run_options(cwd: cwd, returns: [0, 1])).stdout
extract_revision_info(svn_info)
end
@@ -138,7 +138,7 @@ class Chef
def find_current_revision
return nil unless ::File.exist?(::File.join(new_resource.destination, ".svn"))
command = scm(:info)
- svn_info = shell_out!(command, run_options(:cwd => cwd, :returns => [0, 1])).stdout
+ svn_info = shell_out!(command, run_options(cwd: cwd, returns: [0, 1])).stdout
extract_revision_info(svn_info)
end
diff --git a/lib/chef/provider/systemd_unit.rb b/lib/chef/provider/systemd_unit.rb
index 0450516d58..44f34fb8d7 100644
--- a/lib/chef/provider/systemd_unit.rb
+++ b/lib/chef/provider/systemd_unit.rb
@@ -247,8 +247,8 @@ class Chef
if new_resource.user
uid = Etc.getpwnam(new_resource.user).uid
{
- :user => new_resource.user,
- :environment => {
+ user: new_resource.user,
+ environment: {
"DBUS_SESSION_BUS_ADDRESS" => "unix:path=/run/user/#{uid}/bus",
},
}
diff --git a/lib/chef/provider/template/content.rb b/lib/chef/provider/template/content.rb
index b40794564a..9ac5a89b3e 100644
--- a/lib/chef/provider/template/content.rb
+++ b/lib/chef/provider/template/content.rb
@@ -29,7 +29,7 @@ class Chef
def template_location
@template_file_cache_location ||= begin
- template_finder.find(new_resource.source, :local => new_resource.local, :cookbook => new_resource.cookbook)
+ template_finder.find(new_resource.source, local: new_resource.local, cookbook: new_resource.cookbook)
end
end