Skip to content

Commit

Permalink
Fixing some lint and travis problems
Browse files Browse the repository at this point in the history
  • Loading branch information
aerostitch committed Oct 13, 2016
1 parent 70f4e7f commit 15e87c6
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 15 deletions.
28 changes: 18 additions & 10 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
source ENV['GEM_SOURCE'] || 'https://rubygems.org'

group :test do
gem "json_pure", '2.0.1' if RUBY_VERSION < '2.0'
gem "rake"
gem "puppet", ENV['PUPPET_VERSION'] || '~> 3.8.4'
gem "rspec-core", '< 3.2' if RUBY_VERSION < '1.9'
gem "puppet-lint"
gem "rspec-puppet", :git => 'https://github.com/rodjek/rspec-puppet.git'
gem "puppet-syntax"
gem "puppetlabs_spec_helper"
gem "metadata-json-lint"
puppetversion = ENV.key?('PUPPET_VERSION') ? ENV['PUPPET_VERSION'] : ['>= 3.3']
gem "json", '< 2' if RUBY_VERSION < '2.0'
gem "json_pure", '2.0.1' if RUBY_VERSION < '2.0'
gem 'metadata-json-lint'
gem 'puppet', puppetversion
gem 'puppetlabs_spec_helper', '>= 1.0.0'
gem 'puppet-lint', '>= 1.0.0'
gem 'facter', '>= 1.7.0'
gem 'rspec-puppet'

# rspec must be v2 for ruby 1.8.7
if RUBY_VERSION >= '1.8.7' && RUBY_VERSION < '1.9'
gem 'rspec', '~> 2.0'
gem 'rake', '~> 10.0'
elsif RUBY_VERSION < '2'
gem 'rubocop', '< 0.42'
else
gem 'rubocop'
end

group :development do
Expand Down
4 changes: 3 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@

if $install_repository == true {
if $repo_custom_url == undef or $repo_custom_url == '' {
validate_re("$token", '^[0-9a-zA-Z\-]+$', 'You need to provide a valid token. See https://github.com/tubemogul/puppet-maxscale#before-you-begin for more details.')
# From stdlib doc: Compilation terminates if the first argument is not a string. Always use quotes to force stringification
# Dirty hack to avoid only_variable_string lint issue
validate_re("-${token}", '^-[0-9a-zA-Z\-]+$', 'You need to provide a valid token. See https://github.com/tubemogul/puppet-maxscale#before-you-begin for more details.')
}
}

Expand Down
2 changes: 1 addition & 1 deletion manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
} ->
yumrepo { 'maxscale':
enabled => '1',
descr => "MariaDB-MaxScale",
descr => 'MariaDB-MaxScale',
baseurl => $repo_location,
gpgcheck => '1',
gpgkey => 'file:///etc/pki/rpm-gpg/MariaDB-MaxScale-GPG-KEY',
Expand Down
2 changes: 1 addition & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
$repo_keyserver = ''
$repo_release = ''
if $::operatingsystem == 'RedHat' {
$_os = "rhel"
$_os = 'rhel'
} else {
$_os = downcase($::operatingsystem)
}
Expand Down
4 changes: 2 additions & 2 deletions spec/classes/maxscale_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@

it { should create_class('maxscale') }
it { should contain_class('maxscale::params') }
it { should contain_class('maxscale::install').that_comes_before('maxscale::config') }
it { should contain_class('maxscale::install').that_comes_before('Class[maxscale::config]') }
it { should contain_class('maxscale::config') }

it do
Expand Down Expand Up @@ -141,7 +141,7 @@

it { should create_class('maxscale') }
it { should contain_class('maxscale::params') }
it { should contain_class('maxscale::install').that_comes_before('maxscale::config') }
it { should contain_class('maxscale::install').that_comes_before('Class[maxscale::config]') }
it { should contain_class('maxscale::config') }

case osfamily
Expand Down

0 comments on commit 15e87c6

Please sign in to comment.