Skip to content

Commit

Permalink
(PUP-8008) monkey patch spec_helper_acceptance
Browse files Browse the repository at this point in the history
Calls to the forge to get the latest version of the apt module (postgres depends on apt) are failing because of a problem we cannot fix quickly enough (PUP-8008) so this monkey patch will have to do for now. This overloads a method in the module_install_helper to knock apt out of the dependencies list and then install v4.1.0 'manually'
  • Loading branch information
eputnam committed Oct 6, 2017
1 parent 9deb0bd commit 2d3d7c8
Showing 1 changed file with 31 additions and 2 deletions.
33 changes: 31 additions & 2 deletions spec/spec_helper_acceptance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,40 @@

run_puppet_install_helper
install_ca_certs unless ENV['PUPPET_INSTALL_TYPE'] =~ /pe/i
install_module_on(hosts)
install_module_dependencies_on(hosts)

UNSUPPORTED_PLATFORMS = ['AIX','windows','Solaris','Suse']

# monkey patch to get around apt/forge issue (PUP-8008)
module Beaker::ModuleInstallHelper
include Beaker::DSL

def module_dependencies_from_metadata
metadata = module_metadata
return [] unless metadata.key?('dependencies')

dependencies = []

# get it outta here!
metadata['dependencies'].delete_if {|d| d['name'] == 'puppetlabs/apt' }

metadata['dependencies'].each do |d|
tmp = { module_name: d['name'].sub('/', '-') }

if d.key?('version_requirement')
tmp[:version] = module_version_from_requirement(tmp[:module_name],
d['version_requirement'])
end
dependencies.push(tmp)
end

dependencies
end
end

install_module_on(hosts)
install_module_dependencies_on(hosts)
install_module_from_forge_on(hosts,'puppetlabs/apt','< 4.2.0')

class String
# Provide ability to remove indentation from strings, for the purpose of
# left justifying heredoc blocks.
Expand Down

0 comments on commit 2d3d7c8

Please sign in to comment.