Skip to content

Commit 6232a4b

Browse files
Merge pull request #118 from envato/fix-deprecation-warning
Fix deprecation warnings
2 parents 16f9a98 + 631dc6a commit 6232a4b

File tree

3 files changed

+35
-29
lines changed

3 files changed

+35
-29
lines changed

.fixtures.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ fixtures:
1212
repo: 'git://github.com/electrical/puppet-lib-file_concat.git'
1313
apt:
1414
repo: "git://github.com/puppetlabs/puppetlabs-apt"
15-
ref: "1.8.0"
15+
ref: "2.2.0"
1616
symlinks:
1717
puppet: "#{source_dir}"

manifests/repo/puppetlabs.pp

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,37 @@
77
if($::osfamily == 'Debian') {
88
Apt::Source {
99
location => 'http://apt.puppetlabs.com',
10-
key => '47B320EB4C7C375AA9DAE1A01054B7A24BD6EC30',
11-
key_content => template('puppet/pgp.key'),
10+
key => {
11+
'id' => '47B320EB4C7C375AA9DAE1A01054B7A24BD6EC30',
12+
'server' => 'pgp.mit.edu',
13+
},
1214
}
1315
apt::source { 'puppetlabs': repos => 'main' }
1416
apt::source { 'puppetlabs-deps': repos => 'dependencies' }
15-
} elsif $::osfamily == 'Redhat' {
16-
if $::operatingsystem == 'Fedora' {
17-
$ostype='fedora'
18-
$prefix='f'
19-
} else {
20-
$ostype='el'
21-
$prefix=''
22-
}
23-
yumrepo { 'puppetlabs-deps':
24-
baseurl => "http://yum.puppetlabs.com/${ostype}/${prefix}\$releasever/dependencies/\$basearch",
25-
descr => 'Puppet Labs Dependencies $releasever - $basearch ',
26-
enabled => '1',
27-
gpgcheck => '1',
28-
gpgkey => 'http://yum.puppetlabs.com/RPM-GPG-KEY-puppetlabs',
29-
}
30-
31-
yumrepo { 'puppetlabs':
32-
baseurl => "http://yum.puppetlabs.com/${ostype}/${prefix}\$releasever/products/\$basearch",
33-
descr => 'Puppet Labs Products $releasever - $basearch',
34-
enabled => '1',
35-
gpgcheck => '1',
36-
gpgkey => 'http://yum.puppetlabs.com/RPM-GPG-KEY-puppetlabs',
37-
}
17+
} elsif $::osfamily == 'Redhat' {
18+
if $::operatingsystem == 'Fedora' {
19+
$ostype='fedora'
20+
$prefix='f'
3821
} else {
39-
fail("Unsupported osfamily ${::osfamily}")
22+
$ostype='el'
23+
$prefix=''
24+
}
25+
yumrepo { 'puppetlabs-deps':
26+
baseurl => "http://yum.puppetlabs.com/${ostype}/${prefix}\$releasever/dependencies/\$basearch",
27+
descr => 'Puppet Labs Dependencies $releasever - $basearch ',
28+
enabled => '1',
29+
gpgcheck => '1',
30+
gpgkey => 'http://yum.puppetlabs.com/RPM-GPG-KEY-puppetlabs',
31+
}
32+
33+
yumrepo { 'puppetlabs':
34+
baseurl => "http://yum.puppetlabs.com/${ostype}/${prefix}\$releasever/products/\$basearch",
35+
descr => 'Puppet Labs Products $releasever - $basearch',
36+
enabled => '1',
37+
gpgcheck => '1',
38+
gpgkey => 'http://yum.puppetlabs.com/RPM-GPG-KEY-puppetlabs',
4039
}
40+
} else {
41+
fail("Unsupported osfamily ${::osfamily}")
42+
}
4143
}

spec/classes/puppet_repo_puppetlabs_spec.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,20 @@
1010
:lsbdistid => 'Ubuntu',
1111
}
1212
end
13+
let(:key_hash) { {
14+
'id' => '47B320EB4C7C375AA9DAE1A01054B7A24BD6EC30',
15+
'server' => 'pgp.mit.edu',
16+
} }
1317
it 'should contain puppetlabs apt repos' do
1418
should contain_apt__source('puppetlabs').with(
1519
:repos => 'main',
1620
:location => 'http://apt.puppetlabs.com',
17-
:key => '47B320EB4C7C375AA9DAE1A01054B7A24BD6EC30'
21+
:key => key_hash,
1822
)
1923
should contain_apt__source('puppetlabs-deps').with(
2024
:repos => 'dependencies',
2125
:location => 'http://apt.puppetlabs.com',
22-
:key => '47B320EB4C7C375AA9DAE1A01054B7A24BD6EC30'
26+
:key => key_hash,
2327
)
2428
end
2529
end

0 commit comments

Comments
 (0)