Skip to content

Commit 004143f

Browse files
committed
puppet-lint: fix legacy_facts
1 parent bac4877 commit 004143f

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

manifests/init.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
# Module compatibility check
7474
$compatible = [ 'Debian', 'RedHat', 'Suse', 'Gentoo', 'AIX' ]
7575
if ! ($facts['os']['family'] in $compatible) {
76-
fail("Module is not compatible with ${::operatingsystem}")
76+
fail("Module is not compatible with ${facts['os']['name']}")
7777
}
7878

7979
# Anchor pattern to contain dependencies

manifests/install.pp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,9 @@
145145
'rhscl': {
146146
# rhscl is RedHat SCLs from softwarecollections.org
147147
if $python::rhscl_use_public_repository {
148-
$scl_package = "rhscl-${python::version}-epel-${::operatingsystemmajrelease}-${::architecture}"
148+
$scl_package = "rhscl-${python::version}-epel-${facts['os']['release']['major']}-${facts['os']['architecture']}"
149149
package { $scl_package:
150-
source => "https://www.softwarecollections.org/en/scls/rhscl/${python::version}/epel-${::operatingsystemmajrelease}-${::architecture}/download/${scl_package}.noarch.rpm",
150+
source => "https://www.softwarecollections.org/en/scls/rhscl/${python::version}/epel-${facts['os']['release']['major']}-${facts['os']['architecture']}/download/${scl_package}.noarch.rpm",
151151
provider => 'rpm',
152152
tag => 'python-scl-repo',
153153
}
@@ -244,7 +244,7 @@
244244
Class['epel'] -> Package['pip']
245245
}
246246
}
247-
if ($venv_ensure != 'absent') and ($::operatingsystemrelease =~ /^6/) {
247+
if ($venv_ensure != 'absent') and ($facts['os']['release']['full'] =~ /^6/) {
248248
if $python::use_epel == true {
249249
include 'epel'
250250
Class['epel'] -> Package['virtualenv']
@@ -272,11 +272,11 @@
272272
$pip_category = undef
273273
$pip_package = "${python}-pip"
274274
$pip_provider = $python.regsubst(/^.*python3\.?/,'pip3.').regsubst(/\.$/,'')
275-
} elsif ($::osfamily == 'RedHat') and (versioncmp($::operatingsystemmajrelease, '7') >= 0) {
275+
} elsif ($facts['os']['family'] == 'RedHat') and (versioncmp($facts['os']['release']['major'], '7') >= 0) {
276276
$pip_category = undef
277277
$pip_package = 'python2-pip'
278278
$pip_provider = pip2
279-
} elsif $::osfamily == 'Gentoo' {
279+
} elsif $facts['os']['family'] == 'Gentoo' {
280280
$pip_category = 'dev-python'
281281
$pip_package = 'pip'
282282
$pip_provider = 'pip'

manifests/params.pp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
$valid_versions = undef
1616
$manage_scl = true
1717

18-
if $::osfamily == 'RedHat' {
19-
if $::operatingsystem != 'Fedora' {
18+
if $facts['os']['family'] == 'RedHat' {
19+
if $facts['os']['name'] != 'Fedora' {
2020
$use_epel = true
2121
} else {
2222
$use_epel = false

manifests/pyvenv.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
# Debian splits the venv module into a seperate package
4747
if ( $facts['os']['family'] == 'Debian'){
4848
$python3_venv_package="python${normalized_python_version}-venv"
49-
case $facts['lsbdistcodename'] {
49+
case $facts['os']['distro']['codename'] {
5050
'xenial','bionic','cosmic','disco',
5151
'jessie','stretch','buster': {
5252
ensure_packages ($python3_venv_package)

0 commit comments

Comments
 (0)