Showing with 62 additions and 2 deletions.
  1. +8 −0 CHANGELOG.md
  2. +1 −1 metadata.json
  3. +52 −0 spec/acceptance/settings_spec.rb
  4. +1 −1 templates/settings.py.erb
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## [7.0.1](https://github.com/theforeman/puppet-pulpcore/tree/7.0.1) (2022-11-02)

[Full Changelog](https://github.com/theforeman/puppet-pulpcore/compare/7.0.0...7.0.1)

**Fixed bugs:**

- Refs [\#35607](https://projects.theforeman.org/issues/35607) - convert telemetry value to python [\#268](https://github.com/theforeman/puppet-pulpcore/pull/268) ([wbclark](https://github.com/wbclark))

## [7.0.0](https://github.com/theforeman/puppet-pulpcore/tree/7.0.0) (2022-10-28)

[Full Changelog](https://github.com/theforeman/puppet-pulpcore/compare/6.0.0...7.0.0)
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "theforeman-pulpcore",
"version": "7.0.0",
"version": "7.0.1",
"author": "theforeman",
"summary": "Installs next generation Pulp server",
"license": "GPL-3.0-or-later",
Expand Down
52 changes: 52 additions & 0 deletions spec/acceptance/settings_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
require 'spec_helper_acceptance'

describe 'TELEMETRY setting' do
context 'default TELEMETRY' do
it_behaves_like 'an idempotent resource' do
let(:manifest) do
<<-PUPPET
include pulpcore
PUPPET
end
end

describe file('/etc/pulp/settings.py') do
it { is_expected.to be_file }
its(:content) { is_expected.to match(/^# TELEMETRY = False$/) }
end
end

context 'TELEMETRY disabled' do
it_behaves_like 'an idempotent resource' do
let(:manifest) do
<<-PUPPET
class { 'pulpcore':
telemetry => false,
}
PUPPET
end
end

describe file('/etc/pulp/settings.py') do
it { is_expected.to be_file }
its(:content) { is_expected.to match(/^TELEMETRY = False$/) }
end
end

context 'TELEMETRY enabled' do
it_behaves_like 'an idempotent resource' do
let(:manifest) do
<<-PUPPET
class { 'pulpcore':
telemetry => true,
}
PUPPET
end
end

describe file('/etc/pulp/settings.py') do
it { is_expected.to be_file }
its(:content) { is_expected.to match(/^TELEMETRY = True$/) }
end
end
end
2 changes: 1 addition & 1 deletion templates/settings.py.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<% if scope['pulpcore::telemetry'].nil? -%>
# TELEMETRY = False
<% else -%>
TELEMETRY = <%= scope['pulpcore::telemetry'] %>
TELEMETRY = <%= scope.call_function('to_python', [scope['pulpcore::telemetry']]) %>
<% end -%>

CONTENT_HOST = "<%= scope['pulpcore::servername'] %>"
Expand Down