Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions lib/puppet/node/server_facts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@ def self.load
# Add implementation information
server_facts["serverimplementation"] = Puppet.implementation

# Add our server Puppet Enterprise version, if available.
pe_version_file = '/opt/puppetlabs/server/pe_version'
if File.readable?(pe_version_file) and !File.zero?(pe_version_file)
server_facts['pe_serverversion'] = File.read(pe_version_file).chomp
end

# Add our server version to the fact list
server_facts["serverversion"] = Puppet.version.to_s

Expand Down
5 changes: 1 addition & 4 deletions lib/puppet/provider/package/puppetserver_gem.rb
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,7 @@ def self.execute_rubygems_list_command(command_options)
puppet_default_vendor_gems = '/opt/puppetlabs/puppet/lib/ruby/vendor_gems'
puppetserver_default_gem_path = [puppetserver_default_gem_home, puppetserver_default_vendored_jruby_gems, puppet_default_vendor_gems].join(':')

pe_puppetserver_conf_file = '/etc/puppetlabs/puppetserver/conf.d/pe-puppet-server.conf'
os_puppetserver_conf_file = '/etc/puppetlabs/puppetserver/puppetserver.conf'
puppetserver_conf_file = Puppet.runtime[:facter].value(:pe_server_version) ? pe_puppetserver_conf_file : os_puppetserver_conf_file
puppetserver_conf = Hocon.load(puppetserver_conf_file)
puppetserver_conf = Hocon.load('/etc/puppetlabs/puppetserver/puppetserver.conf')

gem_env = {}
if puppetserver_conf.empty? || puppetserver_conf.key?('jruby-puppet') == false
Expand Down
32 changes: 0 additions & 32 deletions spec/unit/indirector/catalog/compiler_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -519,38 +519,6 @@ def a_request_that_contains(facts)
end
end

describe "after finding nodes when checking for a PE version" do
include PuppetSpec::Compiler

let(:pe_version_file) { '/opt/puppetlabs/server/pe_version' }
let(:request) { Puppet::Indirector::Request.new(:catalog, :find, node_name, nil) }

before :each do
Puppet[:code] = 'notify { "PE Version: $pe_serverversion": }'
end

it "should not add 'pe_serverversion' when FOSS" do
allow(Puppet::Node.indirection).to receive(:find).with(node_name, anything).and_return(node)
expect {
catalog = compiler.find(request)
catalog.resource('notify', 'PE Version: 2019.2.0')
}.to raise_error(/Evaluation Error: Unknown variable: 'pe_serverversion'./)
end

it "should add 'pe_serverversion' when PE" do
allow(File).to receive(:readable?).and_call_original
allow(File).to receive(:readable?).with(pe_version_file).and_return(true)
allow(File).to receive(:zero?).with(pe_version_file).and_return(false)
allow(File).to receive(:read).and_call_original
allow(File).to receive(:read).with(pe_version_file).and_return('2019.2.0')

allow(Puppet::Node.indirection).to receive(:find).with(node_name, anything).and_return(node)
catalog = compiler.find(request)

expect(catalog.resource('notify', 'PE Version: 2019.2.0')).to be
end
end

describe "when filtering resources" do
before :each do
@catalog = double('catalog')
Expand Down
Loading