From d448e00fced817582e8dc75cddb641f1b453f3d9 Mon Sep 17 00:00:00 2001 From: "Jeremiah D. Powell" Date: Thu, 3 May 2018 02:47:40 +0800 Subject: [PATCH] support PDK 1.5.10 --- .gitignore | 1 + .pdkignore | 1 + .project | 23 +++++++++++++++++ .travis.yml | 4 ++- CONTRIBUTORS | 1 + Gemfile | 61 ++++++--------------------------------------- Rakefile | 3 +++ metadata.json | 6 ++--- spec/spec_helper.rb | 9 ++++--- 9 files changed, 48 insertions(+), 61 deletions(-) create mode 100644 .project diff --git a/.gitignore b/.gitignore index 56efb9c..49bc2a4 100644 --- a/.gitignore +++ b/.gitignore @@ -19,4 +19,5 @@ /tmp/ /vendor/ /convert_report.txt +/update_report.txt .DS_Store diff --git a/.pdkignore b/.pdkignore index 56efb9c..49bc2a4 100644 --- a/.pdkignore +++ b/.pdkignore @@ -19,4 +19,5 @@ /tmp/ /vendor/ /convert_report.txt +/update_report.txt .DS_Store diff --git a/.project b/.project new file mode 100644 index 0000000..76fd832 --- /dev/null +++ b/.project @@ -0,0 +1,23 @@ + + + waveclaw-subscription_manager + + + + + + com.puppetlabs.geppetto.pp.dsl.ui.modulefileBuilder + + + + + org.eclipse.xtext.ui.shared.xtextBuilder + + + + + + com.puppetlabs.geppetto.pp.dsl.ui.puppetNature + org.eclipse.xtext.ui.shared.xtextNature + + diff --git a/.travis.yml b/.travis.yml index 6b1f5fb..0f10309 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ language: ruby cache: bundler before_install: - bundle -v - - rm Gemfile.lock || true + - rm -f Gemfile.lock - gem update --system - gem update bundler - gem --version @@ -26,6 +26,8 @@ matrix: env: CHECK="syntax lint" - env: CHECK=metadata_lint + - + env: CHECK=release_checks - env: CHECK=spec - diff --git a/CONTRIBUTORS b/CONTRIBUTORS index ff4c6ac..a33bce0 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -16,3 +16,4 @@ pkranenburg Philipp Gassmann (pgassmann phiphi@phiphi.ch) Beat "Scnaeg" Gätzi Wouter Hummelink +Ralf "ralfbosz" Bosz (http://thebosz.com) diff --git a/Gemfile b/Gemfile index 655b014..ce6db39 100644 --- a/Gemfile +++ b/Gemfile @@ -28,10 +28,12 @@ group :development do gem "fast_gettext", require: false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.1.0') gem "json_pure", '<= 2.0.1', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0') gem "json", '= 1.8.1', require: false if Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.1.9') + gem "json", '<= 2.0.4', require: false if Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.4.4') gem "puppet-module-posix-default-r#{minor_version}", require: false, platforms: [:ruby] gem "puppet-module-posix-dev-r#{minor_version}", require: false, platforms: [:ruby] gem "puppet-module-win-default-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw] gem "puppet-module-win-dev-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw] + gem "puppet-blacksmith", '~> 3.4', require: false, platforms: [:ruby] end puppet_version = ENV['PUPPET_GEM_VERSION'] @@ -39,73 +41,24 @@ puppet_type = gem_type(puppet_version) facter_version = ENV['FACTER_GEM_VERSION'] hiera_version = ENV['HIERA_GEM_VERSION'] -def puppet_older_than?(version) - puppet_version = ENV['PUPPET_GEM_VERSION'] - !puppet_version.nil? && - Gem::Version.correct?(puppet_version) && - Gem::Requirement.new("< #{version}").satisfied_by?(Gem::Version.new(puppet_version.dup)) -end - gems = {} gems['puppet'] = location_for(puppet_version) # If facter or hiera versions have been specified via the environment -# variables, use those versions. If not, and if the puppet version is < 3.5.0, -# use known good versions of both for puppet < 3.5.0. -if facter_version - gems['facter'] = location_for(facter_version) -elsif puppet_type == :gem && puppet_older_than?('3.5.0') - gems['facter'] = ['>= 1.6.11', '<= 1.7.5', require: false] -end - -if hiera_version - gems['hiera'] = location_for(ENV['HIERA_GEM_VERSION']) -elsif puppet_type == :gem && puppet_older_than?('3.5.0') - gems['hiera'] = ['>= 1.0.0', '<= 1.3.0', require: false] -end +# variables -if Gem.win_platform? && (puppet_type != :gem || puppet_older_than?('3.5.0')) - # For Puppet gems < 3.5.0 (tested as far back as 3.0.0) on Windows - if puppet_type == :gem - gems['ffi'] = ['1.9.0', require: false] - gems['minitar'] = ['0.5.4', require: false] - gems['win32-eventlog'] = ['0.5.3', '<= 0.6.5', require: false] - gems['win32-process'] = ['0.6.5', '<= 0.7.5', require: false] - gems['win32-security'] = ['~> 0.1.2', '<= 0.2.5', require: false] - gems['win32-service'] = ['0.7.2', '<= 0.8.8', require: false] - else - gems['ffi'] = ['~> 1.9.0', require: false] - gems['minitar'] = ['~> 0.5.4', require: false] - gems['win32-eventlog'] = ['~> 0.5', '<= 0.6.5', require: false] - gems['win32-process'] = ['~> 0.6', '<= 0.7.5', require: false] - gems['win32-security'] = ['~> 0.1', '<= 0.2.5', require: false] - gems['win32-service'] = ['~> 0.7', '<= 0.8.8', require: false] - end - - gems['win32-dir'] = ['~> 0.3', '<= 0.4.9', require: false] - - if RUBY_VERSION.start_with?('1.') - gems['win32console'] = ['1.3.2', require: false] - # sys-admin was removed in Puppet 3.7.0 and doesn't compile under Ruby 2.x - gems['sys-admin'] = ['1.5.6', require: false] - end +gems['facter'] = location_for(facter_version) if facter_version +gems['hiera'] = location_for(hiera_version) if hiera_version - # Puppet < 3.7.0 requires these. - # Puppet >= 3.5.0 gem includes these as requirements. - # The following versions are tested to work with 3.0.0 <= puppet < 3.7.0. - gems['win32-api'] = ['1.4.8', require: false] - gems['win32-taskscheduler'] = ['0.2.2', require: false] - gems['windows-api'] = ['0.4.3', require: false] - gems['windows-pr'] = ['1.2.3', require: false] -elsif Gem.win_platform? +if Gem.win_platform? && puppet_version =~ %r{^(file:///|git://)} # If we're using a Puppet gem on Windows which handles its own win32-xxx gem # dependencies (>= 3.5.0), set the maximum versions (see PUP-6445). gems['win32-dir'] = ['<= 0.4.9', require: false] gems['win32-eventlog'] = ['<= 0.6.5', require: false] gems['win32-process'] = ['<= 0.7.5', require: false] gems['win32-security'] = ['<= 0.2.5', require: false] - gems['win32-service'] = ['<= 0.8.8', require: false] + gems['win32-service'] = ['0.8.8', require: false] end gems.each do |gem_name, gem_params| diff --git a/Rakefile b/Rakefile index 81381e0..fb58663 100644 --- a/Rakefile +++ b/Rakefile @@ -1,2 +1,5 @@ require 'puppetlabs_spec_helper/rake_tasks' require 'puppet-syntax/tasks/puppet-syntax' +require 'puppet_blacksmith/rake_tasks' if Bundler.rubygems.find_name('puppet-blacksmith').any? + +PuppetLint.configuration.send('relative') diff --git a/metadata.json b/metadata.json index 655a0f1..645b662 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "waveclaw-subscription_manager", - "version": "3.3.1", + "version": "3.3.3", "author": "JD Powell ", "summary": "Manage Katello or Satellite registrations.", "license": "Apache-2.0", @@ -54,7 +54,7 @@ } ], "description": "Register CentOS or RHEL to Katello or Satellite 6.", - "pdk-version": "1.4.1", + "pdk-version": "1.5.0", "template-url": "file:///opt/puppetlabs/pdk/share/cache/pdk-templates.git", - "template-ref": "1.4.1-0-g52adbbb" + "template-ref": "1.5.0-0-gd1b3eca" } diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 1279793..e117192 100755 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,3 +1,4 @@ + require 'puppetlabs_spec_helper/module_spec_helper' require 'rspec-puppet-facts' @@ -27,7 +28,9 @@ RSpec.configure do |c| c.default_facts = default_facts + c.before :each do + # set to strictest setting for testing + # by default Puppet runs at warning level + Puppet.settings[:strict] = :warning + end end - - -