From ce4349d1562a6fbfb1221adc7f21b56e594d0ac0 Mon Sep 17 00:00:00 2001 From: Colleen Murphy Date: Mon, 3 Aug 2015 18:34:13 -0700 Subject: [PATCH] Add Gemfile and puppet 4 checks In anticipation of puppet 4, start trying to deal with puppet 4 things that can be helpfully predicted by puppet lint plugins. Also fix lint errors caught by the puppet-lint-absolute_classname-check gem as well as arrow alignment errors not caught before. Change-Id: I6ee8cc21247258d9a37ce3304c207c4b637378f7 --- .gitignore | 2 ++ Gemfile | 30 ++++++++++++++++++++++++++++++ manifests/fetch_remotes.pp | 12 ++++++------ manifests/init.pp | 2 +- manifests/manage_projects.pp | 4 ++-- manifests/openstackwatch.pp | 2 +- 6 files changed, 42 insertions(+), 10 deletions(-) create mode 100644 .gitignore create mode 100644 Gemfile diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..dade81e --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +Gemfile.lock +.bundled_gems/ diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..96912da --- /dev/null +++ b/Gemfile @@ -0,0 +1,30 @@ +source 'https://rubygems.org' + +group :development, :test do + gem 'puppetlabs_spec_helper', :require => false + + gem 'metadata-json-lint' + # This is nice and all, but let's not worry about it until we've actually + # got puppet 4.x sorted + # 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-empty_string-check' + gem 'puppet-lint-leading_zero-check' + gem 'puppet-lint-variable_contains_upcase' + gem 'puppet-lint-spaceship_operator_without_tag-check' + gem 'puppet-lint-undef_in_function-check' + + if puppetversion = ENV['PUPPET_GEM_VERSION'] + gem 'puppet', puppetversion, :require => false + else + gem 'puppet', '~> 3.0', :require => false + end + +end + +# vim:ft=ruby diff --git a/manifests/fetch_remotes.pp b/manifests/fetch_remotes.pp index 0034169..ccd0bee 100644 --- a/manifests/fetch_remotes.pp +++ b/manifests/fetch_remotes.pp @@ -16,16 +16,16 @@ class jeepyb::fetch_remotes( ) { validate_array($log_options) - include jeepyb + include ::jeepyb cron { 'jeepyb_gerritfetchremotes': - ensure => $ensure, - user => $user, - minute => $minute, - command => "sleep $((RANDOM\%60+90)) && /usr/local/bin/manage-projects -v >> ${logfile} 2>&1", + ensure => $ensure, + user => $user, + minute => $minute, + command => "sleep $((RANDOM\%60+90)) && /usr/local/bin/manage-projects -v >> ${logfile} 2>&1", } - include logrotate + include ::logrotate logrotate::file { $logfile: log => $logfile, options => $log_options, diff --git a/manifests/init.pp b/manifests/init.pp index 726c97b..4dcf4f2 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -4,7 +4,7 @@ class jeepyb ( $git_source_repo = 'https://git.openstack.org/openstack-infra/jeepyb', $git_revision = 'master', ) { - include mysql::python + include ::mysql::python if ! defined(Package['python-paramiko']) { package { 'python-paramiko': diff --git a/manifests/manage_projects.pp b/manifests/manage_projects.pp index 7bf381b..463481a 100644 --- a/manifests/manage_projects.pp +++ b/manifests/manage_projects.pp @@ -14,7 +14,7 @@ class jeepyb::manage_projects( ) { validate_array($log_options) - include jeepyb + include ::jeepyb exec { 'jeepyb_manage_projects': command => "/usr/local/bin/manage-projects -v >> ${logfile} 2>&1", @@ -23,7 +23,7 @@ class jeepyb::manage_projects( logoutput => true, } - include logrotate + include ::logrotate logrotate::file { $logfile: log => $logfile, options => $log_options, diff --git a/manifests/openstackwatch.pp b/manifests/openstackwatch.pp index 7a6e8f1..48a8e93 100644 --- a/manifests/openstackwatch.pp +++ b/manifests/openstackwatch.pp @@ -12,7 +12,7 @@ class jeepyb::openstackwatch( $minute = '18', $hour = '*', ) { - include jeepyb + include ::jeepyb group { 'openstackwatch': ensure => present,