summaryrefslogtreecommitdiff
path: root/chef-config
diff options
context:
space:
mode:
authorThom May <thom@chef.io>2016-03-03 11:37:44 +0000
committerThom May <thom@chef.io>2016-03-04 14:47:58 +0000
commitff539423f067ee83c07dcf73cbf688c6a07f64ae (patch)
tree5472f234d9df0892df49313f8407b4c003fab1fe /chef-config
parent788ec4597c9f1517c26d85703bdc79ea01e5ff53 (diff)
downloadchef-ff539423f067ee83c07dcf73cbf688c6a07f64ae.tar.gz
Enable progress output to be configuredtm/remote_file_download_progress
Add tests around progress output and tidy up
Diffstat (limited to 'chef-config')
-rw-r--r--chef-config/lib/chef-config/config.rb6
-rw-r--r--chef-config/spec/unit/config_spec.rb8
2 files changed, 14 insertions, 0 deletions
diff --git a/chef-config/lib/chef-config/config.rb b/chef-config/lib/chef-config/config.rb
index 8161cd9ea7..1455c56082 100644
--- a/chef-config/lib/chef-config/config.rb
+++ b/chef-config/lib/chef-config/config.rb
@@ -299,6 +299,12 @@ module ChefConfig
# Using 'stream_execute_output' will have Chef always stream the execute output
default :stream_execute_output, false
+ # Using `show_download_progress` will display the overall progress
+ # of a remote file download
+ default :show_download_progress, false
+ # How often to update the progress meter, in percent
+ default :download_progress_interval, 10
+
default :http_retry_count, 5
default :http_retry_delay, 5
default :interval, nil
diff --git a/chef-config/spec/unit/config_spec.rb b/chef-config/spec/unit/config_spec.rb
index dbde3d3160..797fe3a233 100644
--- a/chef-config/spec/unit/config_spec.rb
+++ b/chef-config/spec/unit/config_spec.rb
@@ -274,6 +274,14 @@ RSpec.describe ChefConfig::Config do
expect(ChefConfig::Config[:stream_execute_output]).to eq(false)
end
+ it "ChefConfig::Config[:show_download_progress] defaults to false" do
+ expect(ChefConfig::Config[:show_download_progress]).to eq(false)
+ end
+
+ it "ChefConfig::Config[:download_progress_interval] defaults to every 10%" do
+ expect(ChefConfig::Config[:download_progress_interval]).to eq(10)
+ end
+
it "ChefConfig::Config[:file_backup_path] defaults to /var/chef/backup" do
allow(ChefConfig::Config).to receive(:cache_path).and_return(primary_cache_path)
backup_path = is_windows ? "#{primary_cache_path}\\backup" : "#{primary_cache_path}/backup"