From 8d36089dfff34144bebd5d4cb98790f08dda8fd9 Mon Sep 17 00:00:00 2001 From: Matthew Haughton Date: Thu, 23 Apr 2015 09:43:25 -0400 Subject: [PATCH 1/2] location: mini-refactor for puppet 4 Without this an undef will be passed to regsubst when vhost => undef, which causes an error with Puppet 4 so the friendly message from the module won't be shown. --- manifests/resource/location.pp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/manifests/resource/location.pp b/manifests/resource/location.pp index 892be7e07..f9ca49551 100644 --- a/manifests/resource/location.pp +++ b/manifests/resource/location.pp @@ -298,12 +298,6 @@ default => file, } - $vhost_sanitized = regsubst($vhost, ' ', '_', 'G') - $config_file = "${::nginx::config::conf_dir}/sites-available/${vhost_sanitized}.conf" - - $location_sanitized_tmp = regsubst($location, '\/', '_', 'G') - $location_sanitized = regsubst($location_sanitized_tmp, '\\\\', '_', 'G') - ## Check for various error conditions if ($vhost == undef) { fail('Cannot create a location reference without attaching to a virtual host') @@ -320,6 +314,12 @@ warning('The $fastcgi_script parameter is deprecated; please use $fastcgi_param instead to define custom fastcgi_params!') } + $vhost_sanitized = regsubst($vhost, ' ', '_', 'G') + $config_file = "${::nginx::config::conf_dir}/sites-available/${vhost_sanitized}.conf" + + $location_sanitized_tmp = regsubst($location, '\/', '_', 'G') + $location_sanitized = regsubst($location_sanitized_tmp, '\\\\', '_', 'G') + # Use proxy or fastcgi template if $proxy is defined, otherwise use directory template. if ($proxy != undef) { $content_real = template('nginx/vhost/locations/proxy.erb') From 941de4674e56078b6c2fecdb404b6a9afb5c2959 Mon Sep 17 00:00:00 2001 From: Matthew Haughton <3flex@users.noreply.github.com> Date: Wed, 15 Apr 2015 15:25:52 -0400 Subject: [PATCH 2/2] travis: test on Puppet 4 for real No need to test with future parser, the real thing is here. --- .travis.yml | 2 +- Gemfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index fc651b4bc..d3b796949 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,7 +21,7 @@ matrix: - rvm: 2.1.0 env: PUPPET_GEM_VERSION="~> 3.0" - rvm: 2.1.0 - env: PUPPET_GEM_VERSION="~> 3.0" FUTURE_PARSER="yes" + env: PUPPET_GEM_VERSION="~> 4.0" allow_failures: - rvm: 1.8.7 env: PUPPET_GEM_VERSION="~> 2.7.0" diff --git a/Gemfile b/Gemfile index d6373baa5..42468eb1c 100644 --- a/Gemfile +++ b/Gemfile @@ -12,7 +12,7 @@ group :rake, :test do end group :rake do - gem 'rspec-puppet', '>=2', :require => false + gem 'rspec-puppet', '>=2.1.0', :require => false gem 'rake', '>=0.9.2.2' gem 'puppet-lint', '>=1.0.1' end