Skip to content

Commit

Permalink
(maint) Drop unused master_agent_version variable
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed Aug 9, 2023
1 parent e53ca74 commit ac50f84
Show file tree
Hide file tree
Showing 10 changed files with 0 additions and 55 deletions.
8 changes: 0 additions & 8 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,9 @@
else {
$collection = 'puppet8'
}
# The aio puppet-agent version currently installed on the compiling master
# (only used in PE)
if is_function_available('pe_compiling_server_aio_build') {
$master_agent_version = pe_compiling_server_aio_build()
} else {
$master_agent_version = undef
}
} else {
$_pe_version = undef
$pe_repo_dir = undef
$master_agent_version = undef
$collection = 'PC1'
}
}
2 changes: 0 additions & 2 deletions spec/classes/puppet_agent_osfamily_aix_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@

before(:each) do
Puppet::Parser::Functions.newfunction(:pe_build_version, type: :rvalue) { |_args| '2000.0.0' }
Puppet::Parser::Functions.newfunction(:pe_compiling_server_aio_build, type: :rvalue) { |_args| '1.10.100' }
end

it { is_expected.to contain_file('/opt/puppetlabs') }
Expand Down Expand Up @@ -75,7 +74,6 @@

before(:each) do
Puppet::Parser::Functions.newfunction(:pe_build_version, type: :rvalue) { |_args| '2000.0.0' }
Puppet::Parser::Functions.newfunction(:pe_compiling_server_aio_build, type: :rvalue) { |_args| '1.10.100' }
end

it {
Expand Down
5 changes: 0 additions & 5 deletions spec/classes/puppet_agent_osfamily_darwin_spec.rb
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
require 'spec_helper'

describe 'puppet_agent' do
master_package_version = '1.10.100'
before(:each) do
# Need to mock the PE functions
Puppet::Parser::Functions.newfunction(:pe_build_version, type: :rvalue) do |_args|
'2000.0.0'
end

Puppet::Parser::Functions.newfunction(:pe_compiling_server_aio_build, type: :rvalue) do |_args|
master_package_version
end

allow(Puppet::FileSystem).to receive(:exist?).and_call_original
allow(Puppet::FileSystem).to receive(:read_preserve_line_endings).and_call_original
allow(Puppet::FileSystem).to receive(:exist?).with('/opt/puppetlabs/puppet/VERSION').and_return true
Expand Down
4 changes: 0 additions & 4 deletions spec/classes/puppet_agent_osfamily_debian_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@
Puppet::Parser::Functions.newfunction(:pe_build_version, type: :rvalue) do |_args|
'2000.0.0'
end

Puppet::Parser::Functions.newfunction(:pe_compiling_server_aio_build, type: :rvalue) do |_args|
package_version
end
end

let(:facts) do
Expand Down
4 changes: 0 additions & 4 deletions spec/classes/puppet_agent_osfamily_redhat_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,6 @@
Puppet::Parser::Functions.newfunction(:pe_build_version, type: :rvalue) do |_args|
'2000.0.0'
end

Puppet::Parser::Functions.newfunction(:pe_compiling_server_aio_build, type: :rvalue) do |_args|
'5.5.4'
end
end

let(:facts) do
Expand Down
8 changes: 0 additions & 8 deletions spec/classes/puppet_agent_osfamily_solaris_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,6 @@ def install_script(ver, arch)
pe_version
end

Puppet::Parser::Functions.newfunction(:pe_compiling_server_aio_build, type: :rvalue) do |_args|
package_version
end

# Ensure we get a versionable package provider
pkg = Puppet::Type.type(:package)
allow(pkg).to receive(:defaultprovider).and_return(pkg.provider(:pkg))
Expand Down Expand Up @@ -310,10 +306,6 @@ def install_script(ver, arch)
Puppet::Parser::Functions.newfunction(:pe_build_version, type: :rvalue) do |_args|
pe_version
end

Puppet::Parser::Functions.newfunction(:pe_compiling_server_aio_build, type: :rvalue) do |_args|
package_version
end
end

let(:facts) do
Expand Down
4 changes: 0 additions & 4 deletions spec/classes/puppet_agent_osfamily_suse_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,6 @@
Puppet::Parser::Functions.newfunction(:pe_build_version, type: :rvalue) do |_args|
'2000.0.0'
end

Puppet::Parser::Functions.newfunction(:pe_compiling_server_aio_build, type: :rvalue) do |_args|
package_version
end
end

describe 'supported environment' do
Expand Down
4 changes: 0 additions & 4 deletions spec/classes/puppet_agent_osfamily_windows_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@
pe_version
end

Puppet::Parser::Functions.newfunction(:pe_compiling_server_aio_build, type: :rvalue) do |_args|
package_version
end

allow(Puppet::Util).to receive(:absolute_path?).and_call_original
allow(Puppet::Util).to receive(:absolute_path?).with(version_file).and_return true
allow(Puppet::FileSystem).to receive(:exist?).and_call_original
Expand Down
12 changes: 0 additions & 12 deletions spec/classes/puppet_agent_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -201,14 +201,6 @@ def global_facts(facts, os)
end
end

context 'package_version is undef if pe_compiling_server_aio_build is not defined' do
let(:facts) do
global_facts(facts, os).merge(is_pe: true)
end

it { is_expected.to contain_class('puppet_agent').with_package_version(nil) }
end

context 'package_version is same as master when set to auto' do
let(:params) { { package_version: 'auto' } }
let(:node_params) { { serverversion: '7.6.5' } }
Expand Down Expand Up @@ -268,10 +260,6 @@ def global_facts(facts, os)
Puppet::Parser::Functions.newfunction(:pe_build_version, type: :rvalue) do |_args|
'2000.0.0'
end

Puppet::Parser::Functions.newfunction(:pe_compiling_server_aio_build, type: :rvalue) do |_args|
'1.10.100'
end
end
end

Expand Down
4 changes: 0 additions & 4 deletions spec/classes/puppet_agent_windows_install_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@
Puppet::Parser::Functions.newfunction(:pe_build_version, type: :rvalue) do |_args|
'4.10.100'
end

Puppet::Parser::Functions.newfunction(:pe_compiling_server_aio_build, type: :rvalue) do |_args|
package_version
end
end

let(:facts) { facts.merge({ is_pe: true }) }
Expand Down

0 comments on commit ac50f84

Please sign in to comment.