Skip to content

Commit

Permalink
Merge 9d63ac7 into 4061dc1
Browse files Browse the repository at this point in the history
  • Loading branch information
hunner committed Jan 27, 2016
2 parents 4061dc1 + 9d63ac7 commit a6c22d4
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 13 deletions.
3 changes: 0 additions & 3 deletions .rubocop.yml
Expand Up @@ -211,9 +211,6 @@ Style/SpaceInsideParens:
Style/LeadingCommentSpace:
Enabled: false

Style/SingleSpaceBeforeFirstArg:
Enabled: false

Style/SpaceAfterColon:
Enabled: false

Expand Down
6 changes: 3 additions & 3 deletions Gemfile
@@ -1,7 +1,7 @@
source "https://rubygems.org"

if puppetversion = ENV['PUPPET_GEM_VERSION']
gem 'puppet', puppetversion, :require => false
if ENV['PUPPET_GEM_VERSION']
gem 'puppet', ENV['PUPPET_GEM_VERSION'], :require => false
else
gem 'puppet', :require => false
end
Expand All @@ -13,7 +13,7 @@ group :test do
gem "puppetlabs_spec_helper"
gem "metadata-json-lint"
gem "rspec-puppet-facts"
gem 'rubocop'
gem 'rubocop', '0.33.0'
gem 'simplecov'
gem 'simplecov-console'

Expand Down
4 changes: 1 addition & 3 deletions spec/acceptance/hiera_spec.rb
Expand Up @@ -22,7 +22,6 @@
fail "Unknown puppet version #{version}"
end
hierayaml = "#{confdir}/hiera.yaml"
sitepp = File.join(manifestsdir, 'site.pp')

describe 'puppet apply' do
it 'creates a hiera.yaml' do
Expand All @@ -43,7 +42,7 @@ class { 'hiera':
end
describe file(hierayaml), :node => master do
its(:content) do
should match( <<-EOS
should match <<-EOS
# managed by puppet
---
:backends:
Expand All @@ -65,7 +64,6 @@ class { 'hiera':
:pkcs7_private_key: #{confdir}/keys/private_key.pkcs7.pem
:pkcs7_public_key: #{confdir}/keys/public_key.pkcs7.pem
EOS
)
end
end
describe 'querying hiera' do
Expand Down
4 changes: 2 additions & 2 deletions spec/classes/hiera_spec.rb
@@ -1,7 +1,7 @@
require 'spec_helper'

describe 'hiera' do
if Puppet.version.match(/^(Puppet Enterprise )?3/)
if Puppet.version =~ /^(Puppet Enterprise )?3/
context "foss puppet 3" do
let(:facts) do
{ :puppetversion => Puppet.version, }
Expand Down Expand Up @@ -30,7 +30,7 @@
it { should contain_class("hiera::eyaml") }
end
end
elsif Puppet.version.match(/^4/)
elsif Puppet.version =~ /^4/
context "foss puppet 4" do
let(:facts) do
{ :puppetversion => Puppet.version, }
Expand Down
6 changes: 4 additions & 2 deletions spec/spec_helper_acceptance.rb
Expand Up @@ -5,7 +5,7 @@
def wait_for_master(max_retries)
1.upto(max_retries) do |retries|
on(master, "curl -skIL https://#{master.hostname}:8140", { :acceptable_exit_codes => [0,1,7] }) do |result|
return if result.stdout =~ %r{HTTP/1\.1 4}
return true if result.stdout =~ %r{HTTP/1\.1 4}

counter = 2 ** retries
logger.debug "Unable to reach Puppet Master, #{master.hostname}, Sleeping #{counter} seconds for retry #{retries}..."
Expand All @@ -15,14 +15,16 @@ def wait_for_master(max_retries)
raise "Could not connect to Puppet Master."
end

# rubocop:disable AbcSize
def make_site_pp(pp, path = File.join(master['puppetpath'], 'manifests'))
on master, "mkdir -p #{path}"
create_remote_file(master, File.join(path, "site.pp"), pp)
on master, "chown -R #{puppet_user(master)}:#{puppet_group(master)} #{path}"
on master, "chmod -R 0755 #{path}"
on master, "service #{(master['puppetservice']||"puppetserver")} restart"
on master, "service #{(master['puppetservice']||'puppetserver')} restart"
wait_for_master(3)
end
# rubocop:enable AbcSize

run_puppet_install_helper
unless ENV["RS_PROVISION"] == "no" or ENV["BEAKER_provision"] == "no"
Expand Down

0 comments on commit a6c22d4

Please sign in to comment.