Add Puppet 4.x lint checks

- This changes the puppet-lint requirement to 1.1.x, so that we can use
  puppet-lint plugins. Most of these plugins are for 4.x compat, but some just
  catch common errors.

Change-Id: I4f96d4dc285bd6aa0ae5e4294ccd730cc4ee5c45
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
This commit is contained in:
Gael Chamoulaud
2015-03-31 12:01:42 +02:00
parent efa9181201
commit b5c7a00f01
2 changed files with 15 additions and 4 deletions

13
Gemfile
View File

@@ -2,7 +2,18 @@ source 'https://rubygems.org'
group :development, :test do
gem 'puppetlabs_spec_helper', :require => false
gem 'puppet-lint', '~> 0.3.2'
gem 'puppet-lint', '~> 1.1.0'
gem 'puppet-lint-absolute_classname-check'
gem 'puppet-lint-absolute_template_path'
gem 'puppet-lint-trailing_newline-check'
# Puppet 4.x related lint checks
gem 'puppet-lint-unquoted_string-check'
gem 'puppet-lint-leading_zero-check'
gem 'puppet-lint-variable_contains_upcase'
gem 'puppet-lint-numericvariable'
gem 'rspec-puppet', '~> 1.0.1'
gem 'rake', '10.1.1'
gem 'rspec'

View File

@@ -28,9 +28,9 @@ define openstacklib::policy::base (
incl => $file_path,
changes => [
"set dict/entry[last()+1] \"${key}\"",
"set dict/entry[last()]/string \"${value}\""
"set dict/entry[last()]/string \"${value}\"",
],
onlyif => "match dict/entry[*][.=\"${key}\"] size == 0"
onlyif => "match dict/entry[*][.=\"${key}\"] size == 0",
}
# Requires that the entry is added before this call or it will fail.
@@ -38,7 +38,7 @@ define openstacklib::policy::base (
lens => 'Json.lns',
incl => $file_path,
changes => "set dict/entry[*][.=\"${key}\"]/string \"${value}\"",
require => Augeas["${file_path}-${key}-${value}-add"]
require => Augeas["${file_path}-${key}-${value}-add"],
}
}