Skip to content

Commit c516e7a

Browse files
authored
Merge pull request #941 from bastelfreak/ubuntu20
Add ubuntu 20 support
2 parents 0355ae4 + 4b1bdec commit c516e7a

File tree

6 files changed

+13
-37
lines changed

6 files changed

+13
-37
lines changed

manifests/plugin/cuda.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
include collectd
2121

2222
$_manage_package = pick($manage_package, $collectd::manage_package)
23-
if $facts['os']['family'] == 'RedHat' and $facts['os']['release']['major'] == '8' {
23+
if ($facts['os']['family'] == 'RedHat' and $facts['os']['release']['major'] == '8') or ($facts['os']['name'] == 'Ubuntu' and $facts['os']['release']['major'] == '20.04') {
2424
$_python_pip_package = 'python3-pip'
2525
if $package_provider =~ Undef {
2626
$_package_provider = 'pip3'

manifests/plugin/iscdhcp.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

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

23-
if $facts['os']['family'] == 'RedHat' and $facts['os']['release']['major'] == '8' {
23+
if ($facts['os']['family'] == 'RedHat' and $facts['os']['release']['major'] == '8') or ($facts['os']['name'] == 'Ubuntu' and $facts['os']['release']['major'] == '20.04') {
2424
$_python_pip_package = 'python3-pip'
2525
if $package_provider =~ Undef {
2626
$_package_provider = 'pip3'

manifests/plugin/rabbitmq.pp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@
6262
include collectd
6363

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

metadata.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@
6969
"operatingsystem": "Ubuntu",
7070
"operatingsystemrelease": [
7171
"16.04",
72-
"18.04"
72+
"18.04",
73+
"20.04"
7374
]
7475
},
7576
{

spec/classes/collectd_plugin_rabbitmq_spec.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
end
2525

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

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

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

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

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

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

157157
case [facts[:os]['family'], facts[:os]['release']['major']]
158-
when %w[RedHat 8]
158+
when %w[RedHat 8], %w[Ubuntu 20.04]
159159
it { is_expected.to raise_error(%r{does not support Python 3}) }
160160
else
161161
it do

spec/spec_helper_methods.rb

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -15,32 +15,6 @@ def os_specific_options(facts)
1515
end
1616
end
1717

18-
def all_supported_os_hash
19-
{
20-
supported_os: [
21-
{
22-
'operatingsystem' => 'Debian',
23-
'operatingsystemrelease' => ['8']
24-
},
25-
{
26-
'operatingsystem' => 'CentOS',
27-
'operatingsystemrelease' => %w[7 8]
28-
},
29-
{
30-
'operatingsystem' => 'Ubuntu',
31-
'operatingsystemrelease' => %w[16.04 18.04]
32-
},
33-
{
34-
'operatingsystem' => 'FreeBSD',
35-
'operatingsystemrelease' => %w[11 12]
36-
},
37-
{
38-
'operatingsystem' => 'Archlinux'
39-
}
40-
]
41-
}
42-
end
43-
4418
def baseline_os_hash
4519
{
4620
supported_os: [

0 commit comments

Comments
 (0)