Skip to content

Commit 229986c

Browse files
author
Ezra Zygmuntowicz
committed
Merge branch 'master' of git@github.com:hjkp/chef
2 parents c61a910 + 0a1183a commit 229986c

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

chef/lib/chef/mixin/command.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ def run_command(args={})
3737
if Proc === args[:only_if]
3838
res = args[:only_if].call
3939
unless res
40-
Chef::Log.debug("Skipping #{args[:command_string]} - onlyif #{args[:only_if]}")
40+
Chef::Log.debug("Skipping #{args[:command_string]} - only_if #{args[:only_if]}")
4141
return false
4242
end
4343
else
4444
status = popen4(args[:only_if]) { |p, i, o, e| }
4545
if status.exitstatus != 0
46-
Chef::Log.debug("Skipping #{args[:command_string]} - onlyif #{args[:only_if]} returned #{status.exitstatus}")
46+
Chef::Log.debug("Skipping #{args[:command_string]} - only_if #{args[:only_if]} returned #{status.exitstatus}")
4747
return false
4848
end
4949
end
@@ -53,14 +53,14 @@ def run_command(args={})
5353
if Proc === args[:not_if]
5454
res = args[:not_if].call
5555
unless res
56-
Chef::Log.debug("Skipping #{args[:command_string]} - onlyif #{args[:not_if]}")
56+
Chef::Log.debug("Skipping #{args[:command_string]} - not_if #{args[:not_if]}")
5757
return false
5858
end
5959
else
6060
Chef::Log.debug("I should be running '#{args[:not_if]}'")
6161
status = popen4(args[:not_if]) { |p, i, o, e| }
6262
if status.exitstatus == 0
63-
Chef::Log.debug("Skipping #{args[:command_string]} - unless #{args[:not_if]} returned #{status.exitstatus}")
63+
Chef::Log.debug("Skipping #{args[:command_string]} - not_if #{args[:not_if]} returned #{status.exitstatus}")
6464
return false
6565
end
6666
end

chef/lib/chef/rest.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,11 @@ def run_request(method, url, data=false, limit=10, raw=false)
128128
response.read_body do |chunk|
129129
tf.write(chunk)
130130
size += chunk.size
131-
Chef::Log.debug("#{req.path} %d%% done (%d of %d)" % [(size * 100) / total, size, total])
131+
if size == 0
132+
Chef::Log.debug("#{req.path} done (0 length file)")
133+
else
134+
Chef::Log.debug("#{req.path} %d%% done (%d of %d)" % [(size * 100) / total, size, total])
135+
end
132136
end
133137
tf.close
134138
tf

0 commit comments

Comments
 (0)