Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ubuntu 20 support #941

Merged
merged 1 commit into from
Sep 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion manifests/plugin/cuda.pp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
include collectd

$_manage_package = pick($manage_package, $collectd::manage_package)
if $facts['os']['family'] == 'RedHat' and $facts['os']['release']['major'] == '8' {
if ($facts['os']['family'] == 'RedHat' and $facts['os']['release']['major'] == '8') or ($facts['os']['name'] == 'Ubuntu' and $facts['os']['release']['major'] == '20.04') {
$_python_pip_package = 'python3-pip'
if $package_provider =~ Undef {
$_package_provider = 'pip3'
Expand Down
2 changes: 1 addition & 1 deletion manifests/plugin/iscdhcp.pp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

$_manage_package = pick($manage_package, $collectd::manage_package)

if $facts['os']['family'] == 'RedHat' and $facts['os']['release']['major'] == '8' {
if ($facts['os']['family'] == 'RedHat' and $facts['os']['release']['major'] == '8') or ($facts['os']['name'] == 'Ubuntu' and $facts['os']['release']['major'] == '20.04') {
$_python_pip_package = 'python3-pip'
if $package_provider =~ Undef {
$_package_provider = 'pip3'
Expand Down
3 changes: 2 additions & 1 deletion manifests/plugin/rabbitmq.pp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@
include collectd

if $facts['os']['family'] == 'Debian' and versioncmp($facts['os']['release']['major'], '11') >= 0 or
$facts['os']['family'] == 'RedHat' and versioncmp($facts['os']['release']['major'], '8') >= 0 {
$facts['os']['family'] == 'RedHat' and versioncmp($facts['os']['release']['major'], '8') >= 0 or
$facts['os']['name'] == 'Ubuntu' and versioncmp($facts['os']['release']['major'], '20.04') >= 0 {
fail('https://pypi.org/project/collectd-rabbitmq/ does not support Python 3')
}

Expand Down
3 changes: 2 additions & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@
"operatingsystem": "Ubuntu",
"operatingsystemrelease": [
"16.04",
"18.04"
"18.04",
"20.04"
]
},
{
Expand Down
14 changes: 7 additions & 7 deletions spec/classes/collectd_plugin_rabbitmq_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
end

case [facts[:os]['family'], facts[:os]['release']['major']]
when %w[RedHat 8]
when %w[RedHat 8], %w[Ubuntu 20.04]
it { is_expected.to raise_error(%r{does not support Python 3}) }
else
it 'import collectd_rabbitmq.collectd_plugin in python-config' do
Expand Down Expand Up @@ -67,7 +67,7 @@
end

case [facts[:os]['family'], facts[:os]['release']['major']]
when %w[RedHat 8]
when %w[RedHat 8], %w[Ubuntu 20.04]
it { is_expected.to raise_error(%r{does not support Python 3}) }
else
it 'override custom TypesDB' do
Expand All @@ -82,7 +82,7 @@
end

case [facts[:os]['family'], facts[:os]['release']['major']]
when %w[RedHat 8]
when %w[RedHat 8], %w[Ubuntu 20.04]
it { is_expected.to raise_error(%r{does not support Python 3}) }
else
it 'override Username to foo in python-config' do
Expand All @@ -97,7 +97,7 @@
end

case [facts[:os]['family'], facts[:os]['release']['major']]
when %w[RedHat 8]
when %w[RedHat 8], %w[Ubuntu 20.04]
it { is_expected.to raise_error(%r{does not support Python 3}) }
else
it 'override Username to foo in python-config' do
Expand All @@ -112,7 +112,7 @@
end

case [facts[:os]['family'], facts[:os]['release']['major']]
when %w[RedHat 8]
when %w[RedHat 8], %w[Ubuntu 20.04]
it { is_expected.to raise_error(%r{does not support Python 3}) }
else
it 'override Username to foo in python-config' do
Expand All @@ -128,7 +128,7 @@
end

case [facts[:os]['family'], facts[:os]['release']['major']]
when %w[RedHat 8]
when %w[RedHat 8], %w[Ubuntu 20.04]
it { is_expected.to raise_error(%r{does not support Python 3}) }
else
it 'Will remove python-config' do
Expand All @@ -155,7 +155,7 @@
end

case [facts[:os]['family'], facts[:os]['release']['major']]
when %w[RedHat 8]
when %w[RedHat 8], %w[Ubuntu 20.04]
it { is_expected.to raise_error(%r{does not support Python 3}) }
else
it do
Expand Down
26 changes: 0 additions & 26 deletions spec/spec_helper_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,6 @@ def os_specific_options(facts)
end
end

def all_supported_os_hash
{
supported_os: [
{
'operatingsystem' => 'Debian',
'operatingsystemrelease' => ['8']
},
{
'operatingsystem' => 'CentOS',
'operatingsystemrelease' => %w[7 8]
},
{
'operatingsystem' => 'Ubuntu',
'operatingsystemrelease' => %w[16.04 18.04]
},
{
'operatingsystem' => 'FreeBSD',
'operatingsystemrelease' => %w[11 12]
},
{
'operatingsystem' => 'Archlinux'
}
]
}
end

def baseline_os_hash
{
supported_os: [
Expand Down