From 4438badb1499ceed11b32287f861de2ce5961122 Mon Sep 17 00:00:00 2001 From: Sebastien Badia Date: Wed, 25 Feb 2015 16:59:44 +0100 Subject: [PATCH] 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: I3a35ddd0e550a307bd1200fc9aa63e156a508f80 --- Gemfile | 10 ++++++++++ examples/site.pp | 6 +++--- manifests/api.pp | 4 ++-- manifests/generic_service.pp | 4 ++-- manifests/init.pp | 2 +- 5 files changed, 18 insertions(+), 8 deletions(-) diff --git a/Gemfile b/Gemfile index da21c373..b0b2d45f 100644 --- a/Gemfile +++ b/Gemfile @@ -6,6 +6,16 @@ group :development, :test do gem 'metadata-json-lint' gem 'puppet-lint-param-docs' + 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 'json' gem 'webmock' end diff --git a/examples/site.pp b/examples/site.pp index 523783c9..0b9ded95 100644 --- a/examples/site.pp +++ b/examples/site.pp @@ -1,6 +1,6 @@ # This is an example of site.pp to deploy Gnocchi -class { 'gnocchi::keystone::auth': +class { '::gnocchi::keystone::auth': admin_address => '10.0.0.1', internal_address => '10.0.0.1', public_address => '10.0.0.1', @@ -8,11 +8,11 @@ class { 'gnocchi::keystone::auth': region => 'OpenStack' } -class { 'gnocchi': +class { '::gnocchi': database_connection => 'mysql://gnocchi:secrete@10.0.0.1/gnocchi?charset=utf8', } -class { 'gnocchi::api': +class { '::gnocchi::api': bind_host => '10.0.0.1', identity_uri => 'https://identity.openstack.org:35357', keystone_password => 'verysecrete' diff --git a/manifests/api.pp b/manifests/api.pp index 1a7af897..86be53de 100644 --- a/manifests/api.pp +++ b/manifests/api.pp @@ -96,8 +96,8 @@ class gnocchi::api( $ensure_package = 'present', ) inherits gnocchi { - require keystone::python - include gnocchi::params + require ::keystone::python + include ::gnocchi::params Gnocchi_config<||> ~> Exec['post-gnocchi_config'] Gnocchi_config<||> ~> Service['gnocchi-api'] diff --git a/manifests/generic_service.pp b/manifests/generic_service.pp index 91e348d4..7f5594fb 100644 --- a/manifests/generic_service.pp +++ b/manifests/generic_service.pp @@ -35,8 +35,8 @@ define gnocchi::generic_service( $ensure_package = 'present' ) { - include gnocchi::params - include gnocchi::db::sync + include ::gnocchi::params + include ::gnocchi::db::sync $gnocchi_title = "gnocchi-${name}" Exec['post-gnocchi_config'] ~> Service<| title == $gnocchi_title |> diff --git a/manifests/init.pp b/manifests/init.pp index 031d2b9e..bc481cb8 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -33,7 +33,7 @@ class gnocchi( $database_connection = 'sqlite:////var/lib/gnocchi/gnocchi.sqlite', $database_idle_timeout = 3600, ) { - include gnocchi::params + include ::gnocchi::params exec { 'post-gnocchi_config': command => '/bin/echo "Gnocchi config has changed"',