Skip to content
This repository was archived by the owner on May 5, 2023. It is now read-only.

Commit 175cabb

Browse files
committed
Fix legacy facts
1 parent 55a20ba commit 175cabb

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

manifests/extract.pp

+3-3
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
}
7171

7272
if $strip {
73-
if $::osfamily == 'Solaris' or $name !~ /(.tar|.tgz|.tar.gz|.tbz2|.tar.bz2)$/ {
73+
if $facts['os']['family'] == 'Solaris' or $name !~ /(.tar|.tgz|.tar.gz|.tbz2|.tar.bz2)$/ {
7474
warning('strip is only supported with GNU tar, ignoring the parameter')
7575
$strip_opt = ''
7676
} else {
@@ -92,7 +92,7 @@
9292
}
9393

9494
/(.tgz|.tar.gz)$/: {
95-
if $::osfamily == 'Solaris' {
95+
if $facts['os']['family'] == 'Solaris' {
9696
$command = "gunzip -dc < ${source_path} | tar xf - ${untar_opts_real}"
9797
} else {
9898
$command = "tar xzf ${source_path}${strip_opt}${untar_opts_real}"
@@ -116,7 +116,7 @@
116116
}
117117

118118
/.deb$/: {
119-
if $::osfamily == 'Debian' {
119+
if $facts['os']['family'] == 'Debian' {
120120
$command = "dpkg --extract ${source_path} ."
121121
} else {
122122
fail('The .deb filetype is only supported on Debian family systems.')

manifests/params.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# OS specific parameters
22
class staging::params {
3-
case $::osfamily {
3+
case $facts['os']['family'] {
44
default: {
55
$path = '/opt/staging'
66
$owner = '0'

spec/defines/staging_deploy_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
let(:facts) do
44
{
55
caller_module_name: '',
6-
osfamily: 'RedHat',
6+
os: { family: 'RedHat' },
77
staging_http_get: 'curl',
88
path: '/usr/local/bin:/usr/bin:/bin'
99
}

spec/defines/staging_extract_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# forcing a more sane caller_module_name to match real usage.
44
let(:facts) do
55
{
6-
osfamily: 'RedHat',
6+
os: { family: 'RedHat' },
77
path: '/usr/local/bin:/usr/bin:/bin'
88
}
99
end
@@ -200,7 +200,7 @@
200200
describe 'when deploying deb on a Debian family system' do
201201
let(:facts) do
202202
{
203-
osfamily: 'Debian',
203+
os: { family: 'Debian' },
204204
path: '/usr/local/bin:/usr/bin:/bin'
205205
}
206206
end

spec/defines/staging_file_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# forcing a more sane caller_module_name to match real usage.
44
let(:facts) do
55
{
6-
osfamily: 'RedHat',
6+
os: { family: 'RedHat' },
77
staging_http_get: 'curl',
88
puppetversion: Puppet.version
99
}

0 commit comments

Comments
 (0)