Commit a18daee5 authored by Matt Wrock's avatar Matt Wrock Committed by GitHub
Browse files

Merge pull request #93 from chocolatey/download_fail

fixes #88 Always execute chocolatey installer unless guard is satisfied
parents f0bc5a06 e1ea8213
# Changelog for Chocolatey cookbook
### v1.0.1 (2016-07-15)
* Always execute chocolatey installer unless guard is satisfied to allow the install to retry on subsequent attempts if it fails.
### v1.0.0 (2016-03-07)
* No longer dependent on for install script
......@@ -4,7 +4,7 @@ maintainer_email ''
license 'Apache 2.0'
description 'Install chocolatey and packages on Windows'
long_description 'Installs the Chocolatey package manager for Windows and provides a Chef resource for installing nuget packages from'
version '1.0.0'
version '1.0.1'
source_url '' if defined?(:source_url)
issues_url '' if defined?(:issues_url)
......@@ -31,13 +31,11 @@ template install_ps1 do
backup false
source 'InstallChocolatey.ps1.erb'
variables :download_url => node['chocolatey']['install_vars']['chocolateyDownloadUrl']
notifies :run, 'powershell_script[Install Chocolatey]', :immediately
not_if { chocolatey_installed? && (node['chocolatey']['upgrade'] == false) }
powershell_script 'Install Chocolatey' do
action :nothing
environment node['chocolatey']['install_vars']
cwd Chef::Config['file_cache_path']
code install_ps1
not_if { chocolatey_installed? && (node['chocolatey']['upgrade'] == false) }
......@@ -42,14 +42,6 @@ RSpec.describe 'chocolatey::default' do
it 'install.ps1 template notifies powershell_script to run the Chocolatey install script' do
expect(install_template).to notify('powershell_script[Install Chocolatey]').to(:run).immediately
it 'powershell_script does not install Chocolatey unless a new install.ps1 has been downloaded' do
expect(powershell_script).to do_nothing
it 'powershell_script does not set chocolateyProxyLocation' do
expect(powershell_script.environment['chocolateyProxyLocation']).to eq(proxy)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment