Skip to content

Commit a4a1fa3

Browse files
authored
Revert "(#229) Allow openvox installation (#230)" (#237)
This reverts commit d117635. Fixes #236
1 parent b005dbd commit a4a1fa3

File tree

7 files changed

+16
-39
lines changed

7 files changed

+16
-39
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,3 @@ dist
2222
/junit
2323
/log
2424
/doc
25-
/Gemfile.lock

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
### 1.36.1 / 2025-08-12
2+
* Fixed:
3+
* Reverted breaking change (#236)
4+
15
### 1.36.0 / 2025-06-23
26
* Added
37
* Openvox support

Gemfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ group :system_tests do
3737

3838
gem 'bcrypt_pbkdf'
3939
gem 'beaker-rspec'
40-
gem 'beaker_puppet_helpers'
4140
gem 'beaker-windows'
4241
gem 'ed25519'
4342
gem 'net-ssh'

lib/simp/beaker_helpers.rb

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,7 @@ def linux_errata(suts)
764764
u.strip!
765765
u = u.split(':')
766766
%r{^(/|/dev/.*|/s?bin/?.*|/proc/?.*)$}.match?(u[5]) ? [nil] : [u[0], u[5]]
767-
end,
767+
end
768768
]
769769

770770
user_info.each_key do |user|
@@ -1393,7 +1393,7 @@ def pluginsync_on(_suts = hosts)
13931393
#
13941394
# @return [String,Nil] the `puppet-agent` version or nil
13951395
#
1396-
def latest_puppet_agent_version_for(puppet_version, puppet_collection_name = 'puppet')
1396+
def latest_puppet_agent_version_for(puppet_version)
13971397
return nil if puppet_version.nil?
13981398

13991399
require 'rubygems/requirement'
@@ -1418,7 +1418,7 @@ def latest_puppet_agent_version_for(puppet_version, puppet_collection_name = 'pu
14181418
puppet_gems = nil
14191419

14201420
Bundler.with_unbundled_env do
1421-
puppet_gems = `gem search -ra -e #{puppet_collection_name}`.match(%r{\((.+)\)})
1421+
puppet_gems = `gem search -ra -e puppet`.match(%r{\((.+)\)})
14221422
end
14231423

14241424
if puppet_gems
@@ -1467,10 +1467,10 @@ def get_puppet_install_info
14671467

14681468
if puppet_agent_version.nil?
14691469
if (puppet_collection = ENV['BEAKER_PUPPET_COLLECTION'] || host.options['puppet_collection'])
1470-
raise("Error: Puppet Collection '#{puppet_collection}' must match /(puppet|openvox)(\\d+)/") unless puppet_collection =~ %r{(puppet|openvox)(\d+)}
1471-
puppet_collection_name = ::Regexp.last_match(1)
1472-
puppet_install_version = "~> #{::Regexp.last_match(2)}"
1473-
puppet_agent_version = latest_puppet_agent_version_for(puppet_install_version, puppet_collection_name)
1470+
raise("Error: Puppet Collection '#{puppet_collection}' must match /puppet(\\d+)/") unless puppet_collection =~ %r{puppet(\d+)}
1471+
puppet_install_version = "~> #{::Regexp.last_match(1)}"
1472+
puppet_agent_version = latest_puppet_agent_version_for(puppet_install_version)
1473+
14741474
else
14751475
puppet_agent_version = latest_puppet_agent_version_for(DEFAULT_PUPPET_AGENT_VERSION)
14761476
end
@@ -1488,27 +1488,19 @@ def get_puppet_install_info
14881488
}
14891489
end
14901490

1491-
def run_puppet_install_helper_on(hosts)
1492-
block_on hosts, run_in_parallel: true do |host|
1493-
BeakerPuppetHelpers::InstallUtils.install_puppet_release_repo_on(host, ENV['BEAKER_PUPPET_COLLECTION'])
1494-
package_name = ENV.fetch('BEAKER_PUPPET_PACKAGE_NAME', BeakerPuppetHelpers::InstallUtils.collection2packagename(host, ENV['BEAKER_PUPPET_COLLECTION']))
1495-
host.install_package(package_name)
1496-
end
1497-
end
1498-
14991491
# Replacement for `install_puppet` in spec_helper_acceptance.rb
15001492
def install_puppet
15011493
install_info = get_puppet_install_info
15021494

15031495
# In case Beaker needs this info internally
1496+
ENV['PUPPET_INSTALL_VERSION'] = install_info[:puppet_install_version]
15041497
if install_info[:puppet_collection]
15051498
ENV['BEAKER_PUPPET_COLLECTION'] = install_info[:puppet_collection]
15061499
end
15071500

1508-
require 'beaker_puppet_helpers'
1509-
run_puppet_install_helper_on(hosts)
1501+
require 'beaker-puppet'
1502+
install_puppet_on(hosts, version: install_info[:puppet_install_version])
15101503
end
1511-
alias install_openvox install_puppet
15121504

15131505
# Configure all SIMP repos on a host and disable all repos in the disable Array
15141506
#

lib/simp/beaker_helpers/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
module Simp; end
55

66
module Simp::BeakerHelpers
7-
VERSION = '1.36.0'
7+
VERSION = '1.36.1'
88
end

spec/acceptance/suites/default/fixture_modules_spec.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88

99
describe "fact_on(default,'root_home')" do
1010
it 'does not return value of `root_home`' do
11-
pending 'Conflicts with beaker_puppet_helpers' unless Gem::Version.new(pfact_on(default, 'puppetversion').to_s) < Gem::Version.new('8')
12-
expect(Beaker::DSL::Helpers::FacterHelpers.fact_on(default, 'root_home').to_s).to eq ''
11+
expect(fact_on(default, 'root_home').to_s).to eq ''
1312
end
1413
end
1514

spec/lib/simp/beaker_helpers_spec.rb

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,6 @@ def initialize
6464
].join(', ')})\n"
6565
end
6666

67-
let(:openvox_gem_search_results) do
68-
# subset of results, but still exercises code
69-
"openvox (8.19.2, 8.19.1, 8.19.0, 7.37.2, 7.37.1)\n"
70-
end
71-
7267
context '#latest_puppet_agent_version_for' do
7368
context 'using table' do
7469
it 'maps exact Puppet version' do
@@ -211,17 +206,6 @@ def initialize
211206
expect(helper.get_puppet_install_info).to eq expected
212207
end
213208

214-
it 'extracts openvox info from BEAKER_PUPPET_COLLECTION' do
215-
allow(helper).to receive(:`).with('gem search -ra -e openvox').and_return(openvox_gem_search_results)
216-
helper.host.options = { 'puppet_collection' => 'openvox8' }
217-
expected = {
218-
puppet_install_version: '8.19.2',
219-
puppet_collection: 'openvox8',
220-
puppet_install_type: 'agent'
221-
}
222-
expect(helper.get_puppet_install_info).to eq expected
223-
end
224-
225209
it 'extracts info from PUPPET_INSTALL_TYPE' do
226210
ENV['PUPPET_INSTALL_TYPE'] = 'pe'
227211

0 commit comments

Comments
 (0)