summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPrajaktaPurohit <prajakta@opscode.com>2012-05-16 16:03:57 -0700
committerPrajaktaPurohit <prajakta@opscode.com>2012-05-16 16:03:57 -0700
commit856468cd0f08fb2c86af2db46b035391b22f2f26 (patch)
treeb7f2f1f58dfaba67ca7e19a58240e49a252f4975
parent04df647b2ab002bbe673d78ec606ffec9a4a4387 (diff)
downloadchef-856468cd0f08fb2c86af2db46b035391b22f2f26.tar.gz
modify converge-by descriptions to be standlone present-tense for reporting re-use
-rw-r--r--chef/lib/chef/provider/cookbook_file.rb2
-rw-r--r--chef/lib/chef/provider/deploy.rb30
-rw-r--r--chef/lib/chef/provider/erl_call.rb2
-rw-r--r--chef/lib/chef/provider/execute.rb2
-rw-r--r--chef/lib/chef/provider/file.rb8
-rw-r--r--chef/lib/chef/provider/ifconfig.rb12
-rw-r--r--chef/lib/chef/provider/remote_file.rb2
-rw-r--r--chef/lib/chef/provider/template.rb4
8 files changed, 31 insertions, 31 deletions
diff --git a/chef/lib/chef/provider/cookbook_file.rb b/chef/lib/chef/provider/cookbook_file.rb
index b301f8e8dd..e90f5386bf 100644
--- a/chef/lib/chef/provider/cookbook_file.rb
+++ b/chef/lib/chef/provider/cookbook_file.rb
@@ -38,7 +38,7 @@ class Chef
def action_create
if file_cache_location && content_stale?
description = []
- description << "Would create a new cookbook_file #{@new_resource.path}"
+ description << "create a new cookbook_file #{@new_resource.path}"
description << diff_current(file_cache_location)
converge_by(description) do
Chef::Log.debug("#{@new_resource} has new contents")
diff --git a/chef/lib/chef/provider/deploy.rb b/chef/lib/chef/provider/deploy.rb
index 7572c06b6f..9432857824 100644
--- a/chef/lib/chef/provider/deploy.rb
+++ b/chef/lib/chef/provider/deploy.rb
@@ -63,7 +63,7 @@ class Chef
exec.group(@new_resource.group) if @new_resource.group
exec.cwd(release_path) unless exec.cwd
exec.environment(@new_resource.environment) unless exec.environment
- converge_by("Would execute #{command}") do
+ converge_by("execute #{command}") do
exec
end
end
@@ -111,7 +111,7 @@ class Chef
def action_force_deploy
if deployed?(release_path)
- converge_by("Would delete deployed app at #{release_path} prior to force-deploy") do
+ converge_by("delete deployed app at #{release_path} prior to force-deploy") do
Chef::Log.info("Already deployed app at #{release_path}, forcing.")
FileUtils.rm_rf(release_path)
Chef::Log.info("#{@new_resource} forcing deploy of already deployed app at #{release_path}")
@@ -139,7 +139,7 @@ class Chef
rollback
releases_to_nuke.each do |i|
- converge_by("would roll back by removing release #{i}") do
+ converge_by("roll back by removing release #{i}") do
Chef::Log.info "#{@new_resource} removing release: #{i}"
FileUtils.rm_rf i
end
@@ -197,7 +197,7 @@ class Chef
"#{key_and_val.first}='#{key_and_val.last}'"
end.join(" ")
- converge_by("Would execute migration command #{@new_resource.migration_command}") do
+ converge_by("execute migration command #{@new_resource.migration_command}") do
Chef::Log.info "#{@new_resource} migrating #{@new_resource.user} with environment #{env_info}"
run_command(run_options(:command => @new_resource.migration_command, :cwd=>release_path, :log_level => :info))
end
@@ -217,7 +217,7 @@ class Chef
Chef::Log.info("#{@new_resource} restarting app with embedded recipe")
recipe_eval(&restart_cmd)
else
- converge_by("Would restart app using command #{@new_resource.restart_command}") do
+ converge_by("restart app using command #{@new_resource.restart_command}") do
Chef::Log.info("#{@new_resource} restarting app")
run_command(run_options(:command => @new_resource.restart_command, :cwd => @new_resource.current_path))
end
@@ -227,7 +227,7 @@ class Chef
def cleanup!
all_releases[0..-6].each do |old_release|
- converge_by("Would remove old release #{old_release}") do
+ converge_by("remove old release #{old_release}") do
Chef::Log.info "#{@new_resource} removing old release #{old_release}"
FileUtils.rm_rf(old_release)
end
@@ -259,7 +259,7 @@ class Chef
def copy_cached_repo
target_dir_path = @new_resource.deploy_to + "/releases"
- converge_by("Would deploy from repo to #{@target_dir_path} ") do
+ converge_by("deploy from repo to #{@target_dir_path} ") do
FileUtils.mkdir_p(target_dir_path)
run_command(:command => "cp -RPp #{::File.join(@new_resource.destination, ".")} #{release_path}")
Chef::Log.info "#{@new_resource} copied the cached checkout to #{release_path}"
@@ -268,7 +268,7 @@ class Chef
end
def enforce_ownership
- converge_by("would force ownership of #{@new_resource.deploy_to} to #{@new_resource.group}:#{@new_resource.user}") do
+ converge_by("force ownership of #{@new_resource.deploy_to} to #{@new_resource.group}:#{@new_resource.user}") do
FileUtils.chown_R(@new_resource.user, @new_resource.group, @new_resource.deploy_to)
Chef::Log.info("#{@new_resource} set user to #{@new_resource.user}") if @new_resource.user
Chef::Log.info("#{@new_resource} set group to #{@new_resource.group}") if @new_resource.group
@@ -281,8 +281,8 @@ class Chef
end
def link_current_release_to_production
- converge_by(["would remove existing link at #{@new_resource.current_path}",
- "would link release #{release_path} into production at #{@new_resource.current_path}"]) do
+ converge_by(["remove existing link at #{@new_resource.current_path}",
+ "link release #{release_path} into production at #{@new_resource.current_path}"]) do
FileUtils.rm_f(@new_resource.current_path)
begin
FileUtils.ln_sf(release_path, @new_resource.current_path)
@@ -296,7 +296,7 @@ class Chef
def run_symlinks_before_migrate
links_info = @new_resource.symlink_before_migrate.map { |src, dst| "#{src} => #{dst}" }.join(", ")
- converge_by("would make pre-migration symliinks: #{links_info}") do
+ converge_by("make pre-migration symliinks: #{links_info}") do
@new_resource.symlink_before_migrate.each do |src, dest|
begin
FileUtils.ln_sf(@new_resource.shared_path + "/#{src}", release_path + "/#{dest}")
@@ -316,7 +316,7 @@ class Chef
Chef::Log.info("#{@new_resource} created directories before symlinking: #{dirs_info}")
links_info = @new_resource.symlinks.map { |src, dst| "#{src} => #{dst}" }.join(", ")
- converge_by("Would link shared paths into current release: #{links_info}") do
+ converge_by("link shared paths into current release: #{links_info}") do
@new_resource.symlinks.each do |src, dest|
begin
FileUtils.ln_sf(::File.join(@new_resource.shared_path, src), ::File.join(release_path, dest))
@@ -335,7 +335,7 @@ class Chef
def purge_tempfiles_from_current_release
log_info = @new_resource.purge_before_symlink.join(", ")
- converge_by("would purge directories in checkout #{log_info}") do
+ converge_by("purge directories in checkout #{log_info}") do
@new_resource.purge_before_symlink.each { |dir| FileUtils.rm_rf(release_path + "/#{dir}") }
Chef::Log.info("#{@new_resource} purged directories in checkout #{log_info}")
end
@@ -414,7 +414,7 @@ class Chef
Chef::Log.debug "#{@new_resource} not creating #{dir} because it already exists"
return false
end
- converge_by("Would create new directory #{dir}") do
+ converge_by("create new directory #{dir}") do
begin
FileUtils.mkdir_p(dir)
Chef::Log.debug "#{@new_resource} created directory #{dir}"
@@ -443,7 +443,7 @@ class Chef
@release_path = previous_release_path
rollback
end
- converge_by("Would remove failed deploy #{failed_release}") do
+ converge_by("remove failed deploy #{failed_release}") do
Chef::Log.info "Removing failed deploy #{failed_release}"
FileUtils.rm_rf failed_release
end
diff --git a/chef/lib/chef/provider/erl_call.rb b/chef/lib/chef/provider/erl_call.rb
index 899dbfea8b..1ee1da500c 100644
--- a/chef/lib/chef/provider/erl_call.rb
+++ b/chef/lib/chef/provider/erl_call.rb
@@ -59,7 +59,7 @@ class Chef
command = "erl_call -e #{distributed} #{node} #{cookie}"
- converge_by("Would run erlang block") do
+ converge_by("run erlang block") do
begin
pid, stdin, stdout, stderr = popen4(command, :waitlast => true)
diff --git a/chef/lib/chef/provider/execute.rb b/chef/lib/chef/provider/execute.rb
index 86da40e3ab..d6b2f91bab 100644
--- a/chef/lib/chef/provider/execute.rb
+++ b/chef/lib/chef/provider/execute.rb
@@ -58,7 +58,7 @@ class Chef
if STDOUT.tty? && !Chef::Config[:daemon] && Chef::Log.info?
opts[:live_stream] = STDOUT
end
- converge_by("would execute #{@new_resource.command}") do
+ converge_by("execute #{@new_resource.command}") do
result = shell_out!(@new_resource.command, opts)
Chef::Log.info("#{@new_resource} ran successfully")
end
diff --git a/chef/lib/chef/provider/file.rb b/chef/lib/chef/provider/file.rb
index e94da2f000..c26b479fce 100644
--- a/chef/lib/chef/provider/file.rb
+++ b/chef/lib/chef/provider/file.rb
@@ -135,7 +135,7 @@ class Chef
def set_content
unless compare_content
description = []
- description << "Would update content in file #{@new_resource.path} from #{short_cksum(@current_resource.checksum)} to #{short_cksum(new_resource_content_checksum)}"
+ description << "update content in file #{@new_resource.path} from #{short_cksum(@current_resource.checksum)} to #{short_cksum(new_resource_content_checksum)}"
description << diff_current_from_content(@new_resource.content)
converge_by(description) do
backup @new_resource.path if ::File.exists?(@new_resource.path)
@@ -148,7 +148,7 @@ class Chef
def action_create
if !::File.exists?(@new_resource.path)
description = []
- desc = "Would create new file #{@new_resource.path}"
+ desc = "create new file #{@new_resource.path}"
desc << " with content checksum #{short_cksum(new_resource_content_checksum)}" if new_resource.content
description << desc
description << diff_current_from_content(@new_resource.content)
@@ -181,7 +181,7 @@ class Chef
def action_delete
if ::File.exists?(@new_resource.path)
- converge_by("would delete file #{@new_resource.path}") do
+ converge_by("delete file #{@new_resource.path}") do
backup unless ::File.symlink?(@new_resource.path)
::File.delete(@new_resource.path)
Chef::Log.info("#{@new_resource} deleted file at #{@new_resource.path}")
@@ -191,7 +191,7 @@ class Chef
def action_touch
action_create
- converge_by("would update utime on file #{@new_resource.path}") do
+ converge_by("update utime on file #{@new_resource.path}") do
time = Time.now
::File.utime(time, time, @new_resource.path)
Chef::Log.info("#{@new_resource} updated atime and mtime to #{time}")
diff --git a/chef/lib/chef/provider/ifconfig.rb b/chef/lib/chef/provider/ifconfig.rb
index aa36f9d5bd..ba8c16933e 100644
--- a/chef/lib/chef/provider/ifconfig.rb
+++ b/chef/lib/chef/provider/ifconfig.rb
@@ -99,7 +99,7 @@ class Chef
command << " metric #{@new_resource.metric}" if @new_resource.metric
command << " mtu #{@new_resource.mtu}" if @new_resource.mtu
end
- converge_by ("Would run #{command} to add #{@new_resource}") do
+ converge_by ("run #{command} to add #{@new_resource}") do
run_command(
:command => command
)
@@ -122,7 +122,7 @@ class Chef
command << " mtu #{@new_resource.mtu}" if @new_resource.mtu
end
- converge_by ("Would run #{command} to enable #{@new_resource}") do
+ converge_by ("run #{command} to enable #{@new_resource}") do
run_command(
:command => command
)
@@ -135,7 +135,7 @@ class Chef
# check to see if load_current_resource found the interface
if @current_resource.device
command = "ifconfig #{@new_resource.device} down"
- converge_by ("Would run #{command} to delete #{@new_resource}") do
+ converge_by ("run #{command} to delete #{@new_resource}") do
run_command(
:command => command
)
@@ -152,7 +152,7 @@ class Chef
# disables, but leaves config files in place.
if @current_resource.device
command = "ifconfig #{@new_resource.device} down"
- converge_by ("Would run #{command} to disable #{@new_resource}") do
+ converge_by ("run #{command} to disable #{@new_resource}") do
run_command(
:command => command
)
@@ -179,7 +179,7 @@ class Chef
}
template = ::ERB.new(content)
network_file_name = "/etc/sysconfig/network-scripts/ifcfg-#{@new_resource.device}"
- converge_by ("Would generate configuration file : #{network_file_name}") do
+ converge_by ("generate configuration file : #{network_file_name}") do
network_file = ::File.new(network_file_name, "w")
network_file.puts(template.result(b))
network_file.close
@@ -198,7 +198,7 @@ class Chef
when "centos","redhat","fedora"
ifcfg_file = "/etc/sysconfig/network-scripts/ifcfg-#{@new_resource.device}"
if ::File.exist?(ifcfg_file)
- converge_by ("Would delete the #{ifcfg_file}") do
+ converge_by ("delete the #{ifcfg_file}") do
FileUtils.rm_f(ifcfg_file, :verbose => false, :force => true)
end
end
diff --git a/chef/lib/chef/provider/remote_file.rb b/chef/lib/chef/provider/remote_file.rb
index b6644d0b3c..8e22e24bc2 100644
--- a/chef/lib/chef/provider/remote_file.rb
+++ b/chef/lib/chef/provider/remote_file.rb
@@ -43,7 +43,7 @@ class Chef
Chef::Log.debug "#{@new_resource} target and source checksums are the same - not updating"
else
description = []
- description << "Would copy file downloaded from #{@new_resource.source} into #{@new_resource.path}"
+ description << "copy file downloaded from #{@new_resource.source} into #{@new_resource.path}"
description << diff_current(raw_file.path)
converge_by(description) do
backup_new_resource
diff --git a/chef/lib/chef/provider/template.rb b/chef/lib/chef/provider/template.rb
index 606dbe9f39..bcd0fe20ac 100644
--- a/chef/lib/chef/provider/template.rb
+++ b/chef/lib/chef/provider/template.rb
@@ -54,8 +54,8 @@ class Chef
Chef::Log.debug("#{@new_resource} content has not changed.")
else
description = []
- action_message = update ? "Would update #{@current_resource} from #{short_cksum(@current_resource.checksum)} to #{short_cksum(@new_resource.checksum)}" :
- "Would create #{@new_resource}"
+ action_message = update ? "update #{@current_resource} from #{short_cksum(@current_resource.checksum)} to #{short_cksum(@new_resource.checksum)}" :
+ "create #{@new_resource}"
description << action_message
description << diff_current(rendered_template.path)
converge_by(description) do