Skip to content

Commit c0b618f

Browse files
author
Helen Campbell
committed
pdksync_heads/master-0-g34e3266
1 parent 9a09ac9 commit c0b618f

File tree

16 files changed

+79
-84
lines changed

16 files changed

+79
-84
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@
1919
/tmp/
2020
/vendor/
2121
/convert_report.txt
22+
/update_report.txt
2223
.DS_Store

.pdkignore

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
.*.sw[op]
2+
.metadata
3+
.yardoc
4+
.yardwarns
5+
*.iml
6+
/.bundle/
7+
/.idea/
8+
/.vagrant/
9+
/coverage/
10+
/bin/
11+
/doc/
12+
/Gemfile.local
13+
/Gemfile.lock
14+
/junit/
15+
/log/
16+
/pkg/
17+
/spec/fixtures/manifests/
18+
/spec/fixtures/modules/
19+
/tmp/
20+
/vendor/
21+
/convert_report.txt
22+
/update_report.txt
23+
.DS_Store

.rubocop.yml

+10-2
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,14 @@ AllCops:
88
Exclude:
99
- bin/*
1010
- ".vendor/**/*"
11-
- Gemfile
12-
- Rakefile
11+
- "**/Gemfile"
12+
- "**/Rakefile"
1313
- pkg/**/*
1414
- spec/fixtures/**/*
1515
- vendor/**/*
16+
- "**/Puppetfile"
17+
- "**/Vagrantfile"
18+
- "**/Guardfile"
1619
Metrics/LineLength:
1720
Description: People have wide screens, use them.
1821
Max: 200
@@ -65,6 +68,11 @@ Style/SymbolArray:
6568
EnforcedStyle: brackets
6669
RSpec/MessageSpies:
6770
EnforcedStyle: receive
71+
Style/Documentation:
72+
Exclude:
73+
- lib/puppet/parser/functions/**/*
74+
Style/WordArray:
75+
EnforcedStyle: brackets
6876
Style/CollectionMethods:
6977
Enabled: true
7078
Style/MethodCalledOnDoEndBlock:

.travis.yml

+7-13
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ before_install:
77
- bundle -v
88
- rm -f Gemfile.lock
99
- gem update --system
10-
- gem update bundler
1110
- gem --version
1211
- bundle -v
1312
script:
@@ -16,38 +15,33 @@ bundler_args: --without system_tests
1615
rvm:
1716
- 2.4.1
1817
env:
19-
- PUPPET_GEM_VERSION="~> 5.0" CHECK=spec
18+
global:
19+
- BEAKER_PUPPET_COLLECTION=puppet5 PUPPET_GEM_VERSION="~> 5.0"
2020
matrix:
2121
fast_finish: true
2222
include:
2323
-
2424
bundler_args:
2525
dist: trusty
26-
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_set=docker/centos-7
26+
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_set=docker/centos-7
2727
rvm: 2.4.1
2828
script: bundle exec rake beaker
2929
services: docker
3030
sudo: required
3131
-
3232
bundler_args:
3333
dist: trusty
34-
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_set=docker/ubuntu-14.04
34+
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_set=docker/ubuntu-14.04
3535
rvm: 2.4.1
3636
script: bundle exec rake beaker
3737
services: docker
3838
sudo: required
3939
-
40-
env: CHECK=rubocop
40+
env: CHECK="syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop"
4141
-
42-
env: CHECK="syntax lint"
42+
env: CHECK=parallel_spec
4343
-
44-
env: CHECK=metadata_lint
45-
-
46-
env: CHECK=release_checks
47-
-
48-
env: CHECK=spec
49-
-
50-
env: PUPPET_GEM_VERSION="~> 4.0" CHECK=spec
44+
env: PUPPET_GEM_VERSION="~> 4.0" CHECK=parallel_spec
5145
rvm: 2.1.9
5246
branches:
5347
only:

.yardopts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--markup markdown

Gemfile

+7-55
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,12 @@ group :development do
2828
gem "fast_gettext", require: false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.1.0')
2929
gem "json_pure", '<= 2.0.1', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0')
3030
gem "json", '= 1.8.1', require: false if Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.1.9')
31+
gem "json", '<= 2.0.4', require: false if Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.4.4')
3132
gem "puppet-module-posix-default-r#{minor_version}", require: false, platforms: [:ruby]
3233
gem "puppet-module-posix-dev-r#{minor_version}", require: false, platforms: [:ruby]
3334
gem "puppet-module-win-default-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw]
3435
gem "puppet-module-win-dev-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw]
35-
gem "puppet-blacksmith", '~> 3.4', require: false
36+
gem "puppet-blacksmith", '~> 3.4', require: false, platforms: [:ruby]
3637
end
3738
group :system_tests do
3839
gem "puppet-module-posix-system-r#{minor_version}", require: false, platforms: [:ruby]
@@ -49,73 +50,24 @@ puppet_type = gem_type(puppet_version)
4950
facter_version = ENV['FACTER_GEM_VERSION']
5051
hiera_version = ENV['HIERA_GEM_VERSION']
5152

52-
def puppet_older_than?(version)
53-
puppet_version = ENV['PUPPET_GEM_VERSION']
54-
!puppet_version.nil? &&
55-
Gem::Version.correct?(puppet_version) &&
56-
Gem::Requirement.new("< #{version}").satisfied_by?(Gem::Version.new(puppet_version.dup))
57-
end
58-
5953
gems = {}
6054

6155
gems['puppet'] = location_for(puppet_version)
6256

6357
# If facter or hiera versions have been specified via the environment
64-
# variables, use those versions. If not, and if the puppet version is < 3.5.0,
65-
# use known good versions of both for puppet < 3.5.0.
66-
if facter_version
67-
gems['facter'] = location_for(facter_version)
68-
elsif puppet_type == :gem && puppet_older_than?('3.5.0')
69-
gems['facter'] = ['>= 1.6.11', '<= 1.7.5', require: false]
70-
end
71-
72-
if hiera_version
73-
gems['hiera'] = location_for(ENV['HIERA_GEM_VERSION'])
74-
elsif puppet_type == :gem && puppet_older_than?('3.5.0')
75-
gems['hiera'] = ['>= 1.0.0', '<= 1.3.0', require: false]
76-
end
58+
# variables
7759

78-
if Gem.win_platform? && (puppet_type != :gem || puppet_older_than?('3.5.0'))
79-
# For Puppet gems < 3.5.0 (tested as far back as 3.0.0) on Windows
80-
if puppet_type == :gem
81-
gems['ffi'] = ['1.9.0', require: false]
82-
gems['minitar'] = ['0.5.4', require: false]
83-
gems['win32-eventlog'] = ['0.5.3', '<= 0.6.5', require: false]
84-
gems['win32-process'] = ['0.6.5', '<= 0.7.5', require: false]
85-
gems['win32-security'] = ['~> 0.1.2', '<= 0.2.5', require: false]
86-
gems['win32-service'] = ['0.7.2', '<= 0.8.8', require: false]
87-
else
88-
gems['ffi'] = ['~> 1.9.0', require: false]
89-
gems['minitar'] = ['~> 0.5.4', require: false]
90-
gems['win32-eventlog'] = ['~> 0.5', '<= 0.6.5', require: false]
91-
gems['win32-process'] = ['~> 0.6', '<= 0.7.5', require: false]
92-
gems['win32-security'] = ['~> 0.1', '<= 0.2.5', require: false]
93-
gems['win32-service'] = ['~> 0.7', '<= 0.8.8', require: false]
94-
end
95-
96-
gems['win32-dir'] = ['~> 0.3', '<= 0.4.9', require: false]
97-
98-
if RUBY_VERSION.start_with?('1.')
99-
gems['win32console'] = ['1.3.2', require: false]
100-
# sys-admin was removed in Puppet 3.7.0 and doesn't compile under Ruby 2.x
101-
gems['sys-admin'] = ['1.5.6', require: false]
102-
end
60+
gems['facter'] = location_for(facter_version) if facter_version
61+
gems['hiera'] = location_for(hiera_version) if hiera_version
10362

104-
# Puppet < 3.7.0 requires these.
105-
# Puppet >= 3.5.0 gem includes these as requirements.
106-
# The following versions are tested to work with 3.0.0 <= puppet < 3.7.0.
107-
gems['win32-api'] = ['1.4.8', require: false]
108-
gems['win32-taskscheduler'] = ['0.2.2', require: false]
109-
gems['windows-api'] = ['0.4.3', require: false]
110-
gems['windows-pr'] = ['1.2.3', require: false]
111-
elsif Gem.win_platform?
63+
if Gem.win_platform? && puppet_version =~ %r{^(file:///|git://)}
11264
# If we're using a Puppet gem on Windows which handles its own win32-xxx gem
11365
# dependencies (>= 3.5.0), set the maximum versions (see PUP-6445).
11466
gems['win32-dir'] = ['<= 0.4.9', require: false]
11567
gems['win32-eventlog'] = ['<= 0.6.5', require: false]
11668
gems['win32-process'] = ['<= 0.7.5', require: false]
11769
gems['win32-security'] = ['<= 0.2.5', require: false]
118-
gems['win32-service'] = ['<= 0.8.8', require: false]
70+
gems['win32-service'] = ['0.8.8', require: false]
11971
end
12072

12173
gems.each do |gem_name, gem_params|

Rakefile

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
require 'puppetlabs_spec_helper/rake_tasks'
22
require 'puppet-syntax/tasks/puppet-syntax'
3-
require 'puppet_blacksmith/rake_tasks'
4-
require 'puppet-lint/tasks/puppet-lint'
3+
require 'puppet_blacksmith/rake_tasks' if Bundler.rubygems.find_name('puppet-blacksmith').any?
4+
5+
PuppetLint.configuration.send('disable_relative')
6+

lib/puppet/provider/postgresql_conf/parsed.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
text_line :blank, match: %r{^\s*$}
1313

1414
record_line :parsed,
15-
fields: %w[name value comment],
16-
optional: %w[comment],
15+
fields: ['name', 'value', 'comment'],
16+
optional: ['comment'],
1717
match: %r{^\s*([\w\.]+)\s*=?\s*(.*?)(?:\s*#\s*(.*))?\s*$},
1818
to_line: proc { |h|
1919
# simple string and numeric values don't need to be enclosed in quotes

metadata.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
"version_requirement": ">= 4.7.0 < 6.0.0"
7676
}
7777
],
78-
"pdk-version": "1.4.1",
79-
"template-url": "file:///opt/puppetlabs/pdk/share/cache/pdk-templates.git",
80-
"template-ref": "1.4.1-0-g52adbbb"
78+
"pdk-version": "1.5.0",
79+
"template-url": "https://github.com/puppetlabs/pdk-templates",
80+
"template-ref": "heads/master-0-g34e3266"
8181
}

spec/default_facts.yml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Use default_module_facts.yml for module specific facts.
2+
#
3+
# Facts specified here will override the values provided by rspec-puppet-facts.
4+
---
5+
concat_basedir: "/tmp"
6+
ipaddress: "172.16.254.254"
7+
is_pe: false
8+
macaddress: "AA:AA:AA:AA:AA:AA"

spec/spec_helper.rb

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
require 'puppetlabs_spec_helper/module_spec_helper'
23
require 'rspec-puppet-facts'
34

@@ -27,4 +28,9 @@
2728

2829
RSpec.configure do |c|
2930
c.default_facts = default_facts
31+
c.before :each do
32+
# set to strictest setting for testing
33+
# by default Puppet runs at warning level
34+
Puppet.settings[:strict] = :warning
35+
end
3036
end

spec/spec_helper_acceptance.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
run_puppet_install_helper
99
install_ca_certs unless pe_install?
1010

11-
UNSUPPORTED_PLATFORMS = %w[AIX windows Solaris Suse].freeze
11+
UNSUPPORTED_PLATFORMS = ['AIX', 'windows', 'Solaris', 'Suse'].freeze
1212

1313
install_bolt_on(hosts) unless pe_install?
1414
install_module_on(hosts)

spec/unit/defines/server/grant_spec.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@
169169
db: 'test',
170170
role: 'test',
171171
privilege: 'all',
172-
object_name: %w[myschema mytable],
172+
object_name: ['myschema', 'mytable'],
173173
object_type: 'table',
174174
}
175175
end
@@ -193,7 +193,7 @@
193193
db: 'test',
194194
role: 'test',
195195
privilege: 'all',
196-
object_name: %w[myschema mytable],
196+
object_name: ['myschema', 'mytable'],
197197
object_type: 'table',
198198
}
199199
end
@@ -277,7 +277,7 @@ class {'postgresql::server':}
277277
db: 'test',
278278
role: 'test',
279279
privilege: 'all',
280-
object_name: %w[myschema mytable oops],
280+
object_name: ['myschema', 'mytable', 'oops'],
281281
object_type: 'table',
282282
}
283283
end

spec/unit/puppet/provider/postgresql_psql/ruby_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
describe 'with search_path array' do
5858
let(:attributes) do
5959
{
60-
search_path: %w[schema1 schema2],
60+
search_path: ['schema1', 'schema2'],
6161
}
6262
end
6363

spec/unit/puppet/provider/postgresql_replication_slot/ruby_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def | | physical | | | t | | | 0/
3131
end
3232
let(:attributes) { {} }
3333
let(:instances) { provider.class.instances }
34-
let(:expected) { %w[abc def] }
34+
let(:expected) { ['abc', 'def'] }
3535

3636
it 'lists instances #size' do
3737
expect(instances.size).to eq 2

spec/unit/puppet/type/postgresql_psql_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
psql_group: 'postgres',
3333
cwd: '/var/lib',
3434
refreshonly: :true,
35-
search_path: %w[schema1 schema2],
35+
search_path: ['schema1', 'schema2'],
3636
connect_settings: { 'PGHOST' => 'postgres-db-server',
3737
'DBVERSION' => '9.1' },
3838
}.each do |attr, value|

0 commit comments

Comments
 (0)