Skip to content

Commit 4ccb94a

Browse files
committed
Replace lsbdistcodename with operatingsystemmajrelease in order to avoid warning
1 parent 8ba146c commit 4ccb94a

File tree

1 file changed

+16
-20
lines changed

1 file changed

+16
-20
lines changed

manifests/params.pp

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,7 @@
147147
}
148148
}
149149
default: {
150-
fail(translate('Unsupported platform: puppetlabs-%{module_name} currently doesn\'t support %{os}.',
151-
{ 'module_name' => $module_name, 'os' => $::operatingsystem }))
150+
fail("Unsupported platform: puppetlabs-${module_name} currently doesn\'t support ${::operatingsystem}.")
152151
}
153152
}
154153
$config_file = '/etc/my.cnf'
@@ -257,20 +256,18 @@
257256
} else {
258257
$python_package_name = 'python-mysqldb'
259258
}
260-
261-
notice($::lsbdistcodename)
262-
$ruby_package_name = $::lsbdistcodename ? {
263-
'jessie' => 'ruby-mysql',
264-
'stretch' => 'ruby-mysql2',
265-
'buster' => 'ruby-mysql2',
266-
'trusty' => 'ruby-mysql',
267-
'xenial' => 'ruby-mysql',
268-
'bionic' => 'ruby-mysql2',
269-
'focal' => 'ruby-mysql2',
270-
default => 'libmysql-ruby',
271-
}
272-
notice($ruby_package_name)
273-
}
259+
260+
$ruby_package_name = $facts['operatingsystemmajrelease'] ? {
261+
'8' => 'ruby-mysql', # jessie
262+
'9' => 'ruby-mysql2', # stretch
263+
'10' => 'ruby-mysql2', # buster
264+
'14.04' => 'ruby-mysql', # trusty
265+
'16.04' => 'ruby-mysql', # xenial
266+
'18.04' => 'ruby-mysql2', # bionic
267+
'20.04' => 'ruby-mysql2', # focal
268+
default => 'libmysql-ruby',
269+
}
270+
}
274271

275272
'Archlinux': {
276273
$daemon_dev_package_name = undef
@@ -480,8 +477,7 @@
480477
}
481478

482479
default: {
483-
fail(translate('Unsupported platform: puppetlabs-%{module_name} currently doesn\'t support %{osfamily} or %{os}.',
484-
{ 'module_name' => $module_name, 'os' => $::operatingsystem, 'osfamily' => $::osfamily }))
480+
fail("Unsupported platform: puppetlabs-${module_name} currently doesn\'t support ${::osfamily} or ${::operatingsystem}.")
485481
}
486482
}
487483
}
@@ -581,6 +577,6 @@
581577

582578
## Additional graceful failures
583579
if $::osfamily == 'RedHat' and $::operatingsystemmajrelease == '4' and $::operatingsystem != 'Amazon' {
584-
fail(translate('Unsupported platform: puppetlabs-%{module_name} only supports RedHat 5.0 and beyond.', { 'module_name' => $module_name }))
580+
fail("Unsupported platform: puppetlabs-${module_name} only supports RedHat 5.0 and beyond.")
585581
}
586-
}
582+
}

0 commit comments

Comments
 (0)